linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC 1/4] xfs: clean up cow fork reservation and tag inodes correctly
Date: Fri, 18 Nov 2016 10:10:42 -0500	[thread overview]
Message-ID: <20161118151041.GC60705@bfoster.bfoster> (raw)
In-Reply-To: <20161118081146.GA9788@infradead.org>

On Fri, Nov 18, 2016 at 12:11:46AM -0800, Christoph Hellwig wrote:
> On Tue, Nov 15, 2016 at 01:11:01PM -0500, Brian Foster wrote:
> > On Tue, Nov 15, 2016 at 06:16:21AM -0800, Christoph Hellwig wrote:
> > > > +	if (imap->br_startoff != got.br_startoff ||
> > > > +	    imap->br_blockcount != got.br_blockcount)
> > > >  		xfs_inode_set_cowblocks_tag(ip);
> > > 
> > > Can't got.br_blockcount be smaller than imap->br_blockcount if we have
> > > an existing COW fork reservation lying around behind the whole we're
> > > filling?  Also they way xfs_bmapi_reserve_delalloc works the startoff
> > > will be the same.  E.g. this check should probably be:
> > > 
> > 
> > Good point, though I think it can be smaller or larger without
> > necessarily having preallocation due to being merged with surrounding
> > extents. I'm not quite sure what the right answer for that is with
> > regard to tagging, but I do think it's better to have false positive
> > tagging than false negatives.
> 
> Good point, merging can change both the start and length.  Based on
> that I think tagging in the caller of xfs_bmapi_reserve_delalloc is
> wrong, and we need to do it inside xfs_bmapi_reserve_delalloc where
> we know if we did speculative preallocation.

xfs_bmapi_reserve_delalloc() doesn't really know if it's doing
preallocation outside of the extent size hint alignment. I don't think
we want to try and bury all of the prealloc stuff down in the bmapi
code, though we may be able to add a prealloc parameter to
bmapi_reserve_delalloc() such that it can add the prealloc itself and
also tell the difference between prealloc and merge cases. I'll play
around with it, thanks.

Brian

  reply	other threads:[~2016-11-18 15:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 20:27 [PATCH RFC 0/4] xfs: basic cow fork speculative preallocation Brian Foster
2016-11-08 20:27 ` [PATCH RFC 1/4] xfs: clean up cow fork reservation and tag inodes correctly Brian Foster
2016-11-15 14:16   ` Christoph Hellwig
2016-11-15 18:11     ` Brian Foster
2016-11-18  8:11       ` Christoph Hellwig
2016-11-18 15:10         ` Brian Foster [this message]
2016-11-08 20:27 ` [PATCH RFC 2/4] xfs: logically separate iomap range from allocation range Brian Foster
2016-11-15 14:18   ` Christoph Hellwig
2016-11-15 18:11     ` Brian Foster
2016-11-08 20:27 ` [PATCH RFC 3/4] xfs: reuse xfs_file_iomap_begin_delay() for cow fork delalloc Brian Foster
2016-11-15 14:28   ` Christoph Hellwig
2016-11-15 18:11     ` Brian Foster
2016-11-18  8:13       ` Christoph Hellwig
2016-11-18 15:11         ` Brian Foster
2016-11-08 20:27 ` [PATCH RFC 4/4] xfs: implement basic COW fork speculative preallocation Brian Foster
2016-11-08 20:48 ` [PATCH RFC 0/4] xfs: basic cow " Darrick J. Wong
2016-11-08 22:39   ` Brian Foster
2016-11-08 23:34     ` Dave Chinner

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=20161118151041.GC60705@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=hch@infradead.org \
    --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).