From: Greg Banks <gnb-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
To: Neil Brown <neilb@suse.de>
Cc: Jeff Layton <jlayton@redhat.com>,
linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org
Subject: Re: [PATCH 0/3] [RFC] knfsd: convert to kthread API and remove signaling for shutdown
Date: Mon, 19 May 2008 15:00:00 -0700 [thread overview]
Message-ID: <4831F860.6050801@melbourne.sgi.com> (raw)
In-Reply-To: <18481.6416.571430.593722-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
Neil Brown wrote:
> On Saturday May 17, jlayton@redhat.com wrote:
>
>
> With nfsd, the thread *is* the central entity. So killing it does
> make sense.
> This doesn't argue strongly in favour of a killable nfsd, but does
> explain why it might be different from all other kernel threads.
>
There's also the unique history of nfsd, that it was historically a
userspace daemon, so that "killall nfsd" was once the only method of
shutting down nfsds. Arguably we need to preserve that semantic to
avoid breaking distros.
Unfortunately, it's a horrible and racy semantic. At least on SLES10,
the /etc/init.d/ script that performs graceful shutdowns of the NFS
server will do "killall nfsd" and then, without checking to see whether
all the nfsds have actually died, proceeds to run the script that shuts
down the portmapper. If the nfsd are a long time dying, e.g. due to
some slow filesystem work or if you just have a very large number of
nfsds, the last nfsd will try to unregister program 100003 with the the
portmapper after the portmapper is down. This will leave a single nfsd
alive, failing and retrying for a total of hundreds of seconds. During
that time, you can't restart the NFS service.
So while "killall nfsd" needs to continue to work, a additional smarter
mechanism would be great also.
>
> If we replace the BKL usage with a simple global semaphore, that
> problem might just go away. We should only need to protect
> svc_destroy, svc_exit_thread, and svc_set_num_threads from each other.
>
I think we also need to protect those against svc_create_pooled(). I
tried this a few weeks back in an attempt to deal with a customer's
problem, but gave up in disgust when the obvious changes resulted in the
nfsds self-deadlocking during startup. The svc_serv was being created
as a side effect of the first write to a /proc/fs/nfsd/ file, and the
locking was very very confused. I think it would be great if you gave
that code some care and attention.
> It's long past time to discard the BLK here anyway.
>
Very true!
>
>> If this isn't feasible, then I can add the signaling back in, but am not
>> sure whether we can eliminate the race without adding more locking.
>>
>
> I think I prefer keeping the signalling and fixing the locking.
>
I agree.
>
>> Comments and suggestions appreciated...
>>
>>
>
>
Thanks for doing this :-) I'll send out the patch I mentioned when we
chatted at Cthon, maybe you can consider the issue it fixes.
--
Greg Banks, P.Engineer, SGI Australian Software Group.
The cake is *not* a lie.
I don't speak for SGI.
next prev parent reply other threads:[~2008-05-19 22:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-18 2:35 [PATCH 0/3] [RFC] knfsd: convert to kthread API and remove signaling for shutdown Jeff Layton
2008-05-18 2:35 ` [PATCH 1/3] [RFC] knfsd: convert knfsd to kthread API Jeff Layton
2008-05-18 2:35 ` [PATCH 2/3] [RFC] sunrpc: remove unneeded fields from svc_serv struct Jeff Layton
2008-05-18 2:35 ` [PATCH 3/3] [RFC] knfsd: remove signal defines and extraneous variables Jeff Layton
2008-05-19 6:07 ` [PATCH 0/3] [RFC] knfsd: convert to kthread API and remove signaling for shutdown Neil Brown
[not found] ` <18481.6416.571430.593722-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-05-19 21:01 ` Jeff Layton
2008-05-19 22:00 ` Greg Banks [this message]
2008-05-19 23:52 ` Neil Brown
[not found] ` <18482.4782.858347.981553-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-05-20 2:04 ` Greg Banks
2008-05-20 2:24 ` Jeff Layton
[not found] ` <20080519222457.6f24daa5-PC62bkCOHzGdMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2008-05-20 2:34 ` Greg Banks
2008-05-20 11:05 ` Jeff Layton
[not found] ` <483238B3.4010702-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2008-05-20 13:33 ` Talpey, Thomas
2008-05-20 3:13 ` Neil Brown
2008-05-20 11:13 ` Jeff Layton
[not found] ` <18482.16837.381955.636390-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-05-20 20:26 ` Greg Banks
2008-05-20 20:36 ` Greg Banks
[not found] ` <4833364A.4010803-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2008-05-21 1:48 ` Jeff Layton
[not found] ` <20080520214823.576ad7a7-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-05-21 3:29 ` Greg Banks
[not found] ` <48339730.3060206-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2008-05-30 16:25 ` Jeff Layton
[not found] ` <20080530122517.4f18c48e-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-05-30 18:46 ` J. Bruce Fields
2008-05-30 20:59 ` Jeff Layton
2008-06-02 5:51 ` Greg Banks
[not found] ` <48438A76.6000400-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2008-06-02 10:41 ` Jeff Layton
[not found] ` <20080602064132.10c69c88-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-06-03 3:27 ` Greg Banks
[not found] ` <4844BA3C.3010605-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2008-06-03 10:51 ` 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=4831F860.6050801@melbourne.sgi.com \
--to=gnb-cp1dwlodopni96+mszhfpqc/g2k4zdhf@public.gmane.org \
--cc=jlayton@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=nfsv4@linux-nfs.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