From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH][RFC] nfsd/lockd: have locks_in_grace take a sb arg
Date: Tue, 10 Apr 2012 09:18:32 -0400 [thread overview]
Message-ID: <20120410131832.GC18465@fieldses.org> (raw)
In-Reply-To: <20120410071317.0e60bcd5@tlielax.poochiereds.net>
On Tue, Apr 10, 2012 at 07:13:17AM -0400, Jeff Layton wrote:
> Yes, FS implementers should expect that this could get called
> frequently and ensure that it doesn't generate undue load.
>
> I'd expect that any that do this via an upcall would ratelimit it in
> some fashion during the grace period. They'd then set a flag or
> something in the superblock afterward so they wouldn't need to upcall
> anymore once it ends.
>
> I'd rather push those smarts into the filesystems for now though in
> order to allow for more flexibility. There are potential designs where
> a fs could end up back in grace after initially leaving it and we
> should allow for that.
Even then a grace period transition should be rare, so I'd think they'd
want to notify the kernel on the transition rather than polling?
>
> > > @@ -3183,7 +3183,7 @@ nfs4_laundromat(void)
> > > nfs4_lock_state();
> > >
> > > dprintk("NFSD: laundromat service - starting\n");
> > > - if (locks_in_grace())
> > > + if (generic_locks_in_grace())
> > > nfsd4_end_grace();
> >
> > Looking at the code.... This is really just checking whether we've ended
> > our own grace period. The laundromat's scheduled to run a grace period
> > after startup. So I think we should just make this:
> >
> > static bool grace_ended = false;
> >
> > if (!grace_ended) {
> > grace_ended = true;
> > nfsd4_end_grace();
> > }
> >
> > or something. No reason not to do that now.
> >
> > (Hm, and maybe there's a reason to: locks_in_grace() could in theory
> > still return true on a second run of nfs4_laundromat(), but
> > nfsd4_end_grace() probably shouldn't really be run twice?)
> >
>
> Most of the things that nfsd4_end_grace does should be safe to run
> twice. The exception is nfsd4_recdir_purge_old which could be bad news.
> So, doing what you suggest looks reasonable. I'll add that into the next
> respin.
Thanks; that at least I can merge whenever it's ready.
--b.
next prev parent reply other threads:[~2012-04-10 13:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-03 12:14 [PATCH][RFC] nfsd/lockd: have locks_in_grace take a sb arg Jeff Layton
2012-04-09 23:18 ` J. Bruce Fields
2012-04-10 11:13 ` Jeff Layton
2012-04-10 13:18 ` J. Bruce Fields [this message]
2012-04-10 11:44 ` Stanislav Kinsbursky
2012-04-10 12:05 ` Jeff Layton
2012-04-10 12:18 ` Stanislav Kinsbursky
2012-04-10 12:16 ` Jeff Layton
2012-04-10 12:46 ` Stanislav Kinsbursky
2012-04-10 13:39 ` Jeff Layton
2012-04-10 14:52 ` Stanislav Kinsbursky
2012-04-10 18:45 ` Jeff Layton
2012-04-11 10:09 ` Stanislav Kinsbursky
2012-04-11 11:48 ` Jeff Layton
2012-04-11 13:08 ` Stanislav Kinsbursky
2012-04-11 17:19 ` J. Bruce Fields
2012-04-11 17:37 ` Stanislav Kinsbursky
2012-04-11 18:22 ` J. Bruce Fields
2012-04-11 19:24 ` Stanislav Kinsbursky
2012-04-11 22:17 ` J. Bruce Fields
2012-04-12 9:05 ` Stanislav Kinsbursky
2012-04-10 20:22 ` J. Bruce Fields
2012-04-11 10:34 ` Stanislav Kinsbursky
2012-04-11 17:20 ` J. Bruce Fields
2012-04-11 17:33 ` Stanislav Kinsbursky
2012-04-11 17:40 ` Stanislav Kinsbursky
2012-04-11 18:20 ` J. Bruce Fields
2012-04-11 19:39 ` Stanislav Kinsbursky
2012-04-11 19:54 ` J. Bruce Fields
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=20120410131832.GC18465@fieldses.org \
--to=bfields@fieldses.org \
--cc=jlayton@redhat.com \
--cc=linux-nfs@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).