From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com, Mark Tinguely <tinguely@sgi.com>,
Dave Chinner <dchinner@redhat.com>
Subject: Re: xfs speculative preallocation -- fragmentation issue with sparse file handling?
Date: Tue, 19 Feb 2013 10:39:34 +1100 [thread overview]
Message-ID: <20130218233934.GD26694@dastard> (raw)
In-Reply-To: <5122B93E.7060702@redhat.com>
On Mon, Feb 18, 2013 at 06:29:02PM -0500, Brian Foster wrote:
> On 02/18/2013 04:24 PM, Mark Tinguely wrote:
> > On 02/18/13 15:08, Brian Foster wrote:
> > ... the patched version increases in doubles
> >
> > + if (imap[0].br_startblock == HOLESTARTBLOCK)
> > + return 0;
> >
> > vvvvvv
> > + if (imap[0].br_blockcount <= (MAXEXTLEN >> 1))
> > + return imap[0].br_blockcount;
> > ^^^^^^
> >
> > + return XFS_B_TO_FSB(mp, XFS_ISIZE(ip));
> > +}
> >
> > have you experimented without the middle if statement.
> > If I remember correctly when I reviewed the code, that should be moving
> > code closer to the original code; namely use the file size as the
> > preallocation value.
> >
>
> Just a quick update...
>
> I've tested the change above and a suggestion Dave made on IRC to return
> (imap[0].br_blockcount << 1) and both resolve the immediate issue. I
> need to verify the original test case still works and I'll post a patch.
> Thanks...
Though I think you'll find Mark's suggestion reverts preallocation
on sparse files back to the old, undesirable behaviour as it will
prealloc based on the file size on the second 4k of the write at
EOF....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2013-02-18 23:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-18 21:08 xfs speculative preallocation -- fragmentation issue with sparse file handling? Brian Foster
2013-02-18 21:24 ` Mark Tinguely
2013-02-18 23:29 ` Brian Foster
2013-02-18 23:39 ` Dave Chinner [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=20130218233934.GD26694@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=dchinner@redhat.com \
--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