From: Jeff Layton <jlayton@primarydata.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, steved@redhat.com
Subject: [PATCH v3 9/8] nfsd: skip subsequent UMH "create" operations after the first one for v4.0 clients
Date: Wed, 10 Sep 2014 09:22:03 -0400 [thread overview]
Message-ID: <1410355323-25839-1-git-send-email-jlayton@primarydata.com> (raw)
In-Reply-To: <1410187609-10319-1-git-send-email-jlayton@primarydata.com>
In the case of v4.0 clients, we may call into the "create" client
tracking operation multiple times (once for each openowner). Upcalling
for each one of those is wasteful and slow however. We can skip doing
further "create" operations after the first one if we know that one has
already been done.
v4.1+ clients generally only call into this function once (on
RECLAIM_COMPLETE), and we can't skip upcalling on the create even if the
STABLE bit is set. Doing so would make it impossible for nfsdcltrack to
lift the grace period early.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
fs/nfsd/nfs4recover.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 5697e9d2e875..6bd97d1d1880 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -1281,6 +1281,22 @@ nfsd4_umh_cltrack_create(struct nfs4_client *clp)
char *hexid, *reclaim_complete, *grace_start;
struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
+ /*
+ * With v4.0 clients, there's little difference in outcome between a
+ * create and check operation, and we can end up calling into this
+ * function multiple times per client (once for each openowner). So,
+ * for v4.0 clients skip upcalling once the client has been recorded
+ * on stable storage.
+ *
+ * For v4.1+ clients, the outcome of the two operations is different,
+ * so we must ensure that we upcall for the create operation. v4.1+
+ * clients call this on RECLAIM_COMPLETE though, so we should only end
+ * up doing a single create upcall per client.
+ */
+ if (clp->cl_minorversion == 0 &&
+ test_bit(NFSD4_CLIENT_STABLE, &clp->cl_flags))
+ return;
+
hexid = bin_to_hex_dup(clp->cl_name.data, clp->cl_name.len);
if (!hexid) {
dprintk("%s: can't allocate memory for upcall!\n", __func__);
--
1.9.3
prev parent reply other threads:[~2014-09-10 13:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 14:46 [PATCH v3 0/8] nfsd: support for lifting grace period early Jeff Layton
2014-09-08 14:46 ` [PATCH v3 1/8] lockd: move lockd's grace period handling into its own module Jeff Layton
2014-09-08 14:46 ` [PATCH v3 2/8] nfsd: remove redundant boot_time parm from grace_done client tracking op Jeff Layton
2014-09-08 14:46 ` [PATCH v3 3/8] lockd: add a /proc/fs/lockd/nlm_end_grace file Jeff Layton
2014-09-08 14:46 ` [PATCH v3 4/8] nfsd: add a v4_end_grace file to /proc/fs/nfsd Jeff Layton
2014-09-09 12:21 ` Jeff Layton
2014-09-08 14:46 ` [PATCH v3 5/8] nfsd: pass extra info in env vars to upcalls to allow for early grace period end Jeff Layton
2014-09-08 14:46 ` [PATCH v3 6/8] nfsd: serialize nfsdcltrack upcalls for a particular client Jeff Layton
2014-09-08 14:46 ` [PATCH v3 7/8] nfsd: set and test NFSD4_CLIENT_STABLE bit to reduce nfsdcltrack upcalls Jeff Layton
2014-09-09 20:46 ` J. Bruce Fields
2014-09-09 20:56 ` Jeff Layton
2014-09-09 21:19 ` Jeff Layton
2014-09-08 14:46 ` [PATCH v3 8/8] nfsd: reject reclaim request when client has already sent RECLAIM_COMPLETE Jeff Layton
2014-09-10 13:22 ` Jeff Layton [this message]
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=1410355323-25839-1-git-send-email-jlayton@primarydata.com \
--to=jlayton@primarydata.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.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).