From patchwork Mon Oct 13 13:34:41 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 4265 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C4BCBDDFBD for ; Tue, 14 Oct 2008 00:34:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756975AbYJMNex (ORCPT ); Mon, 13 Oct 2008 09:34:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757306AbYJMNex (ORCPT ); Mon, 13 Oct 2008 09:34:53 -0400 Received: from rv-out-0506.google.com ([209.85.198.237]:26498 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756975AbYJMNew (ORCPT ); Mon, 13 Oct 2008 09:34:52 -0400 Received: by rv-out-0506.google.com with SMTP id k40so1836852rvb.1 for ; Mon, 13 Oct 2008 06:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=y1vyUJdYu9SFPTLru0KsQlqKBy3mMF5bOf0bND4oLIk=; b=PTq+AhmEkpwYfDl5/0ftMvsePuShV7kP+D5I+1PccjuOSWLcAXt8nsMgnszSbmamOh WPNGdJZzuY67X6oWGKh/lZpuCvG7aq0oEM1W9ij/Z4Sg7JsxM93kH/QmelZmsI+sg62B Um5mSQsGGwNc9js+KxKwt+mXMXvuSs3ySGA+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=n2gymo7QokzsnvxYmmnJRBuPrWW+8r9cWh/u9tR1tAGcugvDJ92fSu9aWxV5OFBNUq 9FuMMzJX5dOtQbicNT0Efprn+qHcUEf2zytD1Z65k8g1X/5ORHM4HP17dHHAGI2l4S6A zstUhBY+hE0r6LH64+r/Sb9lEzlpk5r55PvoE= Received: by 10.141.211.13 with SMTP id n13mr3726566rvq.12.1223904890798; Mon, 13 Oct 2008 06:34:50 -0700 (PDT) Received: from localhost ([117.192.7.9]) by mx.google.com with ESMTPS id k2sm19084054rvb.1.2008.10.13.06.34.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 13 Oct 2008 06:34:49 -0700 (PDT) Date: Mon, 13 Oct 2008 19:04:41 +0530 From: "Aneesh Kumar K.V" To: Dmitri Monakhov Cc: "Aneesh Kumar K.V" , cmm@us.ibm.com, tytso@mit.edu, sandeen@redhat.com, npiggin@suse.de, linux-ext4@vger.kernel.org Subject: Re: [PATCH 4/4] ext4: Fix file fragmentation during large file write. Message-ID: <20081013133441.GB9578@skywalker> References: <1223751880-16325-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1223751880-16325-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1223751880-16325-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1223751880-16325-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Oct 13, 2008 at 12:31:43AM +0400, Dmitri Monakhov wrote: > "Aneesh Kumar K.V" writes: > > > The range_cyclic writeback mode uses the address_space writeback_index > > as the start index for writeback. With delayed allocation we were > > updating writeback_index wrongly resulting in highly fragmented file. > > Number of extents reduced from 4000 to 27 for a 3GB file with the below > > patch. > Hi i've played with fragmentation patches with following result: > I've had several crash and deadlocks > for example objects wasn't freed on umount: > EXT4-fs: mballoc: 12800 blocks 13 reqs (6 success) > EXT4-fs: mballoc: 7 extents scanned, 12 goal hits, 1 2^N hits, 0 breaks, 0 lost > EXT4-fs: mballoc: 1 generated and it took 3024 > EXT4-fs: mballoc: 7608 preallocated, 1536 discarded > slab error in kmem_cache_destroy(): cache `ext4_prealloc_space': Can't free all objects > Pid: 7703, comm: rmmod Not tainted 2.6.27-rc8 #3 > > Call Trace: > [] kmem_cache_destroy+0x7d/0xc0 > [] exit_ext4_mballoc+0x10/0x1e [ext4dev] > [] exit_ext4_fs+0x1f/0x2f [ext4dev] > [] sys_delete_module+0x199/0x1f3 > [] audit_syscall_entry+0x12d/0x160 > [] system_call_fastpath+0x16/0x1b Looking at the code i found this. I haven't test the change yet. --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 2f38754..acf6a32 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2569,7 +2569,7 @@ static void ext4_mb_cleanup_pa(struct ext4_group_info *grp) pa = list_entry(cur, struct ext4_prealloc_space, pa_group_list); list_del(&pa->pa_group_list); count++; - kfree(pa); + kmem_cache_free(ext4_pspace_cachep, pa); } if (count) mb_debug("mballoc: %u PAs left\n", count);