linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Keyur Govande <keyurgovande@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: XFS fragmentation on file append
Date: Wed, 23 Apr 2014 18:11:50 +1000	[thread overview]
Message-ID: <20140423081150.GQ18672@dastard> (raw)
In-Reply-To: <20140423054719.GJ15995@dastard>

On Wed, Apr 23, 2014 at 03:47:19PM +1000, Dave Chinner wrote:
> On Tue, Apr 22, 2014 at 07:35:34PM -0400, Keyur Govande wrote:
> > I noticed that XFS chooses the AG based on the parent directory's AG
> > and only the next sequential one if there's no space available.
> 
> Yes, that's what the inode64 allocator does. It tries to keep files
> in the same directory close together.
> > @@ -517,7 +517,7 @@ xfs_ialloc_ag_select(
> >          * to mean that blocks must be allocated for them,
> >          * if none are currently free.
> >          */
> > -       agno = pagno;
> > +       agno = ((xfs_agnumber_t) prandom_u32()) % agcount;
> >         flags = XFS_ALLOC_FLAG_TRYLOCK;
> >         for (;;) {
> >                 pag = xfs_perag_get(mp, agno);
> 
> Ugh. That might fix the interleaving, but it randomly distributes
> related files over the entire filesystem. Hence if you have random
> access to the files (like a database does) you now have random seeks
> across the entire filesystem rather than within AGs. You basically
> destroy any concept of data locality that the filesystem has.

BTW, the inode32 allocator (it's a mount option) does this. it's no
longer the default because a) it's always had terrible behaviour for
general workloads compared to inode64 and b) we don't care enough
about 32 bit applications failing to use stat64() anymore to stay
with inode32 by default...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2014-04-23  8:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 22:53 XFS fragmentation on file append Keyur Govande
2014-04-08  1:50 ` Dave Chinner
2014-04-08  3:42   ` Keyur Govande
2014-04-08  5:31     ` Dave Chinner
2014-04-22 23:35       ` Keyur Govande
2014-04-23  5:47         ` Dave Chinner
2014-04-23  8:11           ` Dave Chinner [this message]
2014-04-23 19:05           ` Keyur Govande
2014-04-23 22:52             ` Dave Chinner
2014-04-23 11:48         ` Stewart Smith
2014-04-24  6:54         ` Stefan Ring
2014-04-24 21:49           ` Keyur Govande
2014-05-15 20:25             ` Stefan Ring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140423081150.GQ18672@dastard \
    --to=david@fromorbit.com \
    --cc=keyurgovande@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).