From: Brian Foster <bfoster@redhat.com>
To: Eryu Guan <eguan@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/4] xfs: split indlen reservations fairly when under reserved
Date: Tue, 14 Feb 2017 07:56:08 -0500 [thread overview]
Message-ID: <20170214125607.GA3223@bfoster.bfoster> (raw)
In-Reply-To: <20170214081244.GM24562@eguan.usersys.redhat.com>
On Tue, Feb 14, 2017 at 04:12:44PM +0800, Eryu Guan wrote:
> On Thu, Feb 09, 2017 at 02:34:53PM -0500, Brian Foster wrote:
> > Certain workoads that punch holes into speculative preallocation can
> > cause delalloc indirect reservation splits when the delalloc extent is
> > split in two. If further splits occur, an already short-handed extent
> > can be split into two in a manner that leaves zero indirect blocks for
> > one of the two new extents. This occurs because the shortage is large
> > enough that the xfs_bmap_split_indlen() algorithm completely drains the
> > requested indlen of one of the extents before it honors the existing
> > reservation.
> >
> > This ultimately results in a warning from xfs_bmap_del_extent(). This
> > has been observed during file copies of large, sparse files using 'cp
> > --sparse=always.'
> >
> > To avoid this problem, update xfs_bmap_split_indlen() to explicitly
> > apply the reservation shortage fairly between both extents. This smooths
> > out the overall indlen shortage and defers the situation where we end up
> > with a delalloc extent with zero indlen reservation to extreme
> > circumstances.
> >
> > Reported-by: Patrick Dung <mpatdung@gmail.com>
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > ---
> > fs/xfs/libxfs/xfs_bmap.c | 61 ++++++++++++++++++++++++++++++++++--------------
> > 1 file changed, 43 insertions(+), 18 deletions(-)
> >
> > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> > index 49edea4..e27b9ee 100644
> > --- a/fs/xfs/libxfs/xfs_bmap.c
> > +++ b/fs/xfs/libxfs/xfs_bmap.c
> > @@ -4790,6 +4790,7 @@ xfs_bmap_split_indlen(
> > xfs_filblks_t len2 = *indlen2;
> > xfs_filblks_t nres = len1 + len2; /* new total res. */
> > xfs_filblks_t stolen = 0;
> > + xfs_filblks_t resfactor;
> >
> > trace_printk("%d: ores %llu len1 %llu len2 %llu\n", __LINE__, ores, len1, len2);
>
> Is this line a leftover from debug code? Patch doesn't apply with this
> line on top of 4.10-rc8 kernel.
>
Oops.. looks like I forgot to pull that stuff out of my branch. I'll
post a new set with it removed.
Brian
> Thanks,
> Eryu
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-02-14 12:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 19:34 [PATCH v2 0/4] buffered write and indlen fixes Brian Foster
2017-02-09 19:34 ` [PATCH 1/4] xfs: clear delalloc and cache on buffered write failure Brian Foster
2017-02-09 19:34 ` [PATCH 2/4] xfs: resurrect debug mode drop buffered writes mechanism Brian Foster
2017-02-09 19:34 ` [PATCH 3/4] xfs: handle indlen shortage on delalloc extent merge Brian Foster
2017-02-09 19:34 ` [PATCH 4/4] xfs: split indlen reservations fairly when under reserved Brian Foster
2017-02-09 20:45 ` Darrick J. Wong
2017-02-14 8:12 ` Eryu Guan
2017-02-14 12:56 ` Brian Foster [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-02-14 13:03 [PATCH v3 0/4] buffered write and indlen fixes Brian Foster
2017-02-14 13:03 ` [PATCH 4/4] xfs: split indlen reservations fairly when under reserved Brian Foster
2017-02-16 20:26 ` Christoph Hellwig
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=20170214125607.GA3223@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=eguan@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/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).