public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs@oss.sgi.com
Subject: Re: block allocations for the refcount btree
Date: Tue, 1 Mar 2016 12:40:13 -0800	[thread overview]
Message-ID: <20160301204013.GA23128@infradead.org> (raw)
In-Reply-To: <20160301181809.GC27973@birch.djwong.org>

On Tue, Mar 01, 2016 at 10:18:09AM -0800, Darrick J. Wong wrote:
> One side effect of the per-ag block reservation code is that it reserves all
> the blocks that the refcountbt will ever need at mount time, which includes
> decreasing the incore fdblocks counter at mount and putting it back at unmount
> time.  This /should/ eliminate the need for reserving blocks in truncate
> transactions, though clearly this isn't being done correctly.

We're still accouting these blocks in t_blk_res_used through
xfs_alloc_vextent -> xfs_alloc_ag_vextent -> xfs_trans_mod_sb.

I don't really see how the reservation code changes anything about
that accounting.  It just ensures the allocation will succeed through
xfs_ag_resv_needed in xfs_alloc_ag_vextent, and then removes the
allocated block from the reservation using xfs_ag_resv_alloc_block.

Maybe we need to find a way to not account for these blocks.

> So what I'm saying is that I think this problem was with the AGresv code not
> doing accounting correctly, and that I've fixed it in a subsequent rewrite of
> the AGresv code.  I'll post it later, after I figure out why generic/333
> regresses with the new code.

Ok, let's see if the new version helps with the above issue.

> However, there's one thing to be aware of -- if the AGresv uses up all the
> blocks that were preallocated at mount time, the allocator will grab any free
> blocks available and charge the blocks to the transaction, just like before.
> If this ever happens (in theory we reserve enough blocks so that we can have a
> refcount record for every block in the AG) then we'll still have this problem.

It seems like we should simply avoid that this case ever happens.

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

  reply	other threads:[~2016-03-01 20:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10  9:30 block allocations for the refcount btree Christoph Hellwig
2016-02-10  9:50 ` Darrick J. Wong
2016-02-10 19:07   ` Christoph Hellwig
2016-02-10 21:40     ` Dave Chinner
2016-02-11 14:09       ` Brian Foster
2016-02-11 20:21         ` Dave Chinner
2016-02-12 19:10       ` Christoph Hellwig
2016-02-13  2:33         ` Dave Chinner
2016-02-13  4:44           ` Darrick J. Wong
2016-02-13  8:02             ` Christoph Hellwig
2016-02-13  7:48           ` Christoph Hellwig
2016-02-14  0:21             ` Dave Chinner
2016-03-01 18:18         ` Darrick J. Wong
2016-03-01 20:40           ` Christoph Hellwig [this message]
2016-03-02  5:24             ` Darrick J. Wong
2016-03-02  9:59               ` Christoph Hellwig
2016-03-02 16:41                 ` Darrick J. Wong
2016-03-02 16:57                   ` Christoph Hellwig
2016-03-02 21:21                     ` Darrick J. Wong
2016-03-03 14:05                       ` Christoph Hellwig
2016-03-04  1:36                         ` Darrick J. Wong

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=20160301204013.GA23128@infradead.org \
    --to=hch@infradead.org \
    --cc=darrick.wong@oracle.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