From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
xfs <linux-xfs@vger.kernel.org>
Subject: Re: [RFC PATCH] xfs: try to avoid blowing out the transaction reservation when bunmaping a shared extent
Date: Tue, 2 May 2017 08:05:25 -0400 [thread overview]
Message-ID: <20170502120523.GA6975@bfoster.bfoster> (raw)
In-Reply-To: <20170502080023.GA17675@infradead.org>
On Tue, May 02, 2017 at 01:00:23AM -0700, Christoph Hellwig wrote:
> On Fri, Apr 28, 2017 at 12:40:32PM -0700, Darrick J. Wong wrote:
> > So either we have to keep the AGF buffer locked and attached across
> > all the transaction rolls until we around to processing the refcount
> > decrement deferred op, or figure out something else clever...?
>
> We can't. We need to unlock the AGF buffer over rolls because we
> must not lock two AGF buffers unless we can ensure they are in
> increasing agno order. For the alloc path we go great length to
> ensure this, but we will also need to do that for the free path,
> which currently is a problem due to the two extents we free per
> transaction.
>
But doesn't that mean this wouldn't be a new problem introduced by such
a change?
Stepping back and taking a look at the code, I realize we don't
currently lock the agf until xfs_free_extent() or
xfs_refcount_finish_one(), which is the deferred op. I assume Darrick's
previous example thus requires that we introduce locking of the AGF
during the unmap for reflinked files, but it seems to me we can end up
locking two AGFs as such whether we do the locking in the unmap or in
the deferred ops (as we do today). IOW, the only difference here seems
to be whether we do the locking before or after the transaction roll..?
> Maybe we need to move away from the defer everything in one defer_ops
> scheme to target defers instead so that we can keep the AGF locked
> where needed and release it when we can't keep it locked.
Yeah, I'm very much in favor of targeted use of such mechanisms for
situations where there is a specific purpose, whether it be lock order
management or atomicity of operations too large for a single
transaction. That being said, I'm not following your thought wrt to this
particular situation. Are you suggesting that we not defer the reflink
adjustment in particular unmap cases, or that we just limit the number
of extent unmaps per-tp based on crossing an AG boundary, or something
else entirely?
Brian
> --
> 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-05-02 12:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 2:09 [RFC PATCH] xfs: try to avoid blowing out the transaction reservation when bunmaping a shared extent Darrick J. Wong
2017-04-26 13:59 ` Brian Foster
2017-04-26 21:37 ` Darrick J. Wong
2017-04-27 7:35 ` Christoph Hellwig
2017-04-28 19:40 ` Darrick J. Wong
2017-05-01 14:58 ` Brian Foster
2017-05-02 8:00 ` Christoph Hellwig
2017-05-02 12:05 ` Brian Foster [this message]
2017-05-04 11:59 ` Christoph Hellwig
2017-05-04 13:40 ` Brian Foster
2017-04-27 7:40 ` Christoph Hellwig
2017-04-27 15:58 ` 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=20170502120523.GA6975@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.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