From: =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: [PATCH] ext4: add noorlov parameter to avoid spreading of directory inodes Date: Wed, 2 Oct 2013 18:44:56 +0200 (CEST) Message-ID: References: <20131001160817.GA2295@kvack.org> <20131002144759.GB32181@quack.suse.cz> <524C3574.7020106@redhat.com> <20131002153101.GE4353@kvack.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Eric Sandeen , Jan Kara , "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org To: Benjamin LaHaise Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39059 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839Ab3JBQpG (ORCPT ); Wed, 2 Oct 2013 12:45:06 -0400 In-Reply-To: <20131002153101.GE4353@kvack.org> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Wed, 2 Oct 2013, Benjamin LaHaise wrote: > Date: Wed, 2 Oct 2013 11:31:01 -0400 > From: Benjamin LaHaise > To: Eric Sandeen > Cc: Jan Kara , Theodore Ts'o , > Andreas Dilger , linux-ext4@vger.kernel.org > Subject: Re: [PATCH] ext4: add noorlov parameter to avoid spreading of > directory inodes > > On Wed, Oct 02, 2013 at 10:02:12AM -0500, Eric Sandeen wrote: > > I'm right with you on thinking a mount option should be a last resort. > > > > One thing I'm curious about - what changed from ext3 to ext4? I thought > > both defaulted to orlov and the same type of allocation behavior, more > > or less. I guess one change is that the "oldalloc" mount > > option went away. > > > (if it does come back, it should probably mirror what we had before, > > which was "oldalloc" not "noorlov" right?) > > The behaviour I'm looking for is not exactly the same as the orlov > allocator or the old allocator, but something that packs files as > closely together as possible. Half of this can be achieved with > fallocate(), but reducing the spreading of directory inodes can only be > accomplished with changes to the filesystem itself. The only reason > we're using multiple subdirectories is because of contention issues with > i_mutex (our application has to either fsync() the directory or mount > with dirsync to maintain consistency) during file creation and unlink(). What is the frequency of unlink operation in comparison to file creation ? There is a possible issue with the global goal cursors s_mb_last_group and s_mb_last_start which might make your files increasingly scattered across the disk. I've attempted to address this problem with my patch ext4: Try to better reuse recently freed space What is the usual size of the files this application is creating ? Thanks! -Lukas