public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Myers <bpm@sgi.com>
To: Jan Kara <jack@suse.cz>
Cc: dchinner@redhat.com, tinguely@sgi.com, xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs: Avoid pathological backwards allocation
Date: Mon, 20 May 2013 13:10:38 -0500	[thread overview]
Message-ID: <20130520181038.GY29359@sgi.com> (raw)
In-Reply-To: <20130520135607.GA11502@quack.suse.cz>

On Mon, May 20, 2013 at 03:56:07PM +0200, Jan Kara wrote:
> On Thu 11-04-13 22:09:56, Jan Kara wrote:
> > Writing a large file using direct IO in 16 MB chunks sometimes results
> > in a pathological allocation pattern where 16 MB chunks of large free
> > extent are allocated to a file in a reversed order. So extents of a file
> > look for example as:
> > 
> >  ext logical physical expected length flags
> >    0        0        13          4550656
> >    1  4550656 188136807   4550668 12562432
> >    2 17113088 200699240 200699238 622592
> >    3 17735680 182046055 201321831   4096
> >    4 17739776 182041959 182050150   4096
> >    5 17743872 182037863 182046054   4096
> >    6 17747968 182033767 182041958   4096
> >    7 17752064 182029671 182037862   4096
> > ...
> > 6757 45400064 154381644 154389835   4096
> > 6758 45404160 154377548 154385739   4096
> > 6759 45408256 252951571 154381643  73728 eof
> > 
> > This happens because XFS_ALLOCTYPE_THIS_BNO allocation fails (the last
> > extent in the file cannot be further extended) so we fall back to
> > XFS_ALLOCTYPE_NEAR_BNO allocation which picks end of a large free
> > extent as the best place to continue the file. Since the chunk at the
> > end of the free extent again cannot be further extended, this behavior
> > repeats until the whole free extent is consumed in a reversed order.
> > 
> > For data allocations this backward allocation isn't beneficial so make
> > xfs_alloc_compute_diff() pick start of a free extent instead of its end
> > for them. That avoids the backward allocation pattern.
> > 
> > See thread at http://oss.sgi.com/archives/xfs/2013-03/msg00144.html for
> > more details about the reproduction case and why this solution was
> > chosen.
> > 
> > Based on idea by Dave Chinner <dchinner@redhat.com>.
> > 
> > CC: Dave Chinner <dchinner@redhat.com>
> > Reviewed-by: Dave Chinner <dchinner@redhat.com>
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  fs/xfs/xfs_alloc.c |   24 ++++++++++++++++++------
> >  1 files changed, 18 insertions(+), 6 deletions(-)
> > 
> > v2: Updated comment and commit description.
>   Could anybody pull this patch into XFS tree? I don't see it there...

Applied.

Thanks Jan.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2013-05-20 18:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 20:09 [PATCH v2] xfs: Avoid pathological backwards allocation Jan Kara
2013-04-16 15:41 ` Mark Tinguely
2013-05-20 13:56 ` Jan Kara
2013-05-20 14:57   ` Mark Tinguely
2013-05-20 18:10   ` Ben Myers [this message]

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=20130520181038.GY29359@sgi.com \
    --to=bpm@sgi.com \
    --cc=dchinner@redhat.com \
    --cc=jack@suse.cz \
    --cc=tinguely@sgi.com \
    --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