From: Christoph Hellwig <hch@infradead.org>
To: Jeff Layton <jlayton@primarydata.com>
Cc: bfields@fieldses.org, linux-nfs@vger.kernel.org,
trond.myklebust@primarydata.com, hch@infradead.org
Subject: Re: [PATCH v2 2/2] nfsd: avoid taking the state_lock while holding the i_lock
Date: Sat, 7 Jun 2014 07:09:04 -0700 [thread overview]
Message-ID: <20140607140904.GB18140@infradead.org> (raw)
In-Reply-To: <1402060026-26511-3-git-send-email-jlayton@primarydata.com>
On Fri, Jun 06, 2014 at 09:07:06AM -0400, Jeff Layton wrote:
> state_lock is a heavily contended global lock. We don't want to grab
> that while simultaneously holding the inode->i_lock. Avoid doing that in
> the delegation break callback by ensuring that we add/remove the
> dl_perfile under a new per-nfs4_file fi_lock, and hold that while walking
> the fi_delegations list.
>
> We still do need to queue the delegations to the global del_recall_lru
> list. Do that in the rpc_prepare op for the delegation recall RPC. It's
> possible though that the allocation of the rpc_task will fail, which
> would cause the delegation to be leaked.
>
> If that occurs rpc_release is still called, so we also do it there if
> the rpc_task failed to run. This brings up another dilemma -- how do
> we know whether it got queued in rpc_prepare or not?
>
> In order to determine that, we set the dl_time to 0 in the delegation
> break callback from the VFS and only set it when we queue it to the
> list. If it's still zero by the time we get to rpc_release, then we know
> that it never got queued and we can do it then.
Compared to this version I have to say the original one that I objected
to looks like the lesser evil. I'll take another deeper look at it.
next prev parent reply other threads:[~2014-06-07 14:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 13:07 [PATCH v2 0/2] nfsd: preliminary patches for client_mutex removal Jeff Layton
2014-06-06 13:07 ` [PATCH v2 1/2] nfsd: Protect addition to the file_hashtbl Jeff Layton
2014-06-06 14:14 ` Christoph Hellwig
2014-06-06 13:07 ` [PATCH v2 2/2] nfsd: avoid taking the state_lock while holding the i_lock Jeff Layton
2014-06-07 14:09 ` Christoph Hellwig [this message]
2014-06-07 14:28 ` Jeff Layton
2014-06-07 14:31 ` Christoph Hellwig
2014-06-07 14:34 ` Jeff Layton
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=20140607140904.GB18140@infradead.org \
--to=hch@infradead.org \
--cc=bfields@fieldses.org \
--cc=jlayton@primarydata.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.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;
as well as URLs for NNTP newsgroup(s).