Linux NFS development
 help / color / mirror / Atom feed
From: Greg Banks <gnb-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org, neilb@suse.de
Subject: Re: [PATCH 4/5] knfsd: convert knfsd to kthread API
Date: Tue, 10 Jun 2008 20:50:57 +1000	[thread overview]
Message-ID: <484E5C91.6000502@melbourne.sgi.com> (raw)
In-Reply-To: <20080609145459.1adda51a-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>

Jeff Layton wrote:
> On Mon, 9 Jun 2008 14:39:23 -0400
> "J. Bruce Fields" <bfields@fieldses.org> wrote:
>
>   
>> On Mon, Jun 09, 2008 at 09:19:48AM -0400, Jeff Layton wrote:
>>     
>>> On Mon, 9 Jun 2008 09:08:30 -0400
>>> "J. Bruce Fields" <bfields@fieldses.org> wrote:
>>>
>>>       
>>>> On Fri, Jun 06, 2008 at 03:49:48PM -0400, Jeff Layton wrote:
>>>>         
>>>>> On Fri, 6 Jun 2008 14:11:16 -0400
>>>>> Jeff Layton <jlayton@redhat.com> wrote:
>>>>>
>>>>>           
>>>>>> On Fri, 6 Jun 2008 13:24:31 -0400
>>>>>> "J. Bruce Fields" <bfields@fieldses.org> wrote:
>>>>>>
>>>>>>             
>>>>> ...
>>>>>           
>>>>>>> How does the module refcounting work after this patch?
>>>>>>>
>>>>>>> --b.
>>>>>>>
>>>>>>>               
>>>>>> I think I've goofed this part, actually. I was thinking that we didn't
>>>>>> need to bump the refcount here, and that the kernel would realize that
>>>>>> nfsd() hadn't returned and would prevent unloading until it had. This
>>>>>> doesn't seem to be the case. I'll need to go back and add refcounting
>>>>>> back in.
>>>>>>
>>>>>>             
>>>>> Here's a respun patch that adds back in the module refcounts and also
>>>>> removes the unneeded "err = 0;" at the bottom of the loop. Thoughts?
>>>>>           
>>>> Looks good to me.  I'll apply all 5 (with this version of #4) if noone
>>>> catches something else.
>>>>
>>>> --b.
>>>>
>>>>         
>>> Sounds good. My only concern here is whether moving the __module_get
>>> from the RPC layer to nfsd() itself is OK.
>>>       
>> Oh, I see, I missed that.
>>
>>     
>>> I *think* it is since the
>>> nfsctl and /proc/fs/nfsd routines are all part of the nfsd module, so
>>> we're guaranteed to have a reference there anyway, but if there are
>>> potential races then we may want to go back to the old way.
>>>       
>> The vfs should take care that e.g. it gets a reference on the module
>> before creating an open file for the nfsd filesystem. 
Yes, but indirectly; I believe the module refcount belongs to the nfsd
filesystem super_block, and having an open file on that filesystem keeps
a vfsmount refcount which keeps the super_block refcount which keeps the
module refcount.
>>  But it don't see
>> how anything can guarantee that the __module_get() in the new nfsd
>> thread completes before whoever called svc_set_num_threads() returns and
>> drops their reference.
>>
>> So, yeah, I think it's not right.
>>
>>     
Agreed.
>
> Ok, that makes sense. I'll need to respin the set then since we'll need
> the sv_module field in the svc_serv struct after all. Let me do that
> and get back to you...
>
>   

Bother, I think that's right.

-- 
Greg Banks, P.Engineer, SGI Australian Software Group.
The cake is *not* a lie.
I don't speak for SGI.


  parent reply	other threads:[~2008-06-10 10:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 15:12 [PATCH 0/5] Convert knfsd to kthread API and fix startup/shutdown races (try #3) Jeff Layton
2008-06-06 15:12 ` [PATCH 1/5] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking Jeff Layton
2008-06-06 15:12   ` [PATCH 2/5] knfsd: clean up nfsd filesystem interfaces Jeff Layton
2008-06-06 15:12     ` [PATCH 3/5] knfsd: remove special handling for SIGHUP Jeff Layton
2008-06-06 15:12       ` [PATCH 4/5] knfsd: convert knfsd to kthread API Jeff Layton
2008-06-06 15:12         ` [PATCH 5/5] sunrpc: remove unneeded fields from svc_serv struct Jeff Layton
2008-06-06 17:24         ` [PATCH 4/5] knfsd: convert knfsd to kthread API J. Bruce Fields
2008-06-06 18:11           ` Jeff Layton
2008-06-06 18:16             ` J. Bruce Fields
2008-06-06 19:05               ` Jeff Layton
     [not found]                 ` <20080606150537.14c9537c-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-06-06 19:13                   ` J. Bruce Fields
2008-06-06 19:49             ` Jeff Layton
     [not found]               ` <20080606154948.303aba28-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-06-09 13:08                 ` J. Bruce Fields
2008-06-09 13:19                   ` Jeff Layton
     [not found]                     ` <20080609091948.0b2b19a9-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-06-09 18:39                       ` J. Bruce Fields
2008-06-09 18:54                         ` Jeff Layton
     [not found]                           ` <20080609145459.1adda51a-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-06-10 10:50                             ` Greg Banks [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-10 12:40 [PATCH 0/5] Convert knfsd to kthread API and fix startup/shutdown races (try #4) Jeff Layton
2008-06-10 12:40 ` [PATCH 1/5] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking Jeff Layton
2008-06-10 12:40   ` [PATCH 2/5] knfsd: clean up nfsd filesystem interfaces Jeff Layton
2008-06-10 12:40     ` [PATCH 3/5] knfsd: remove special handling for SIGHUP Jeff Layton
2008-06-10 12:40       ` [PATCH 4/5] knfsd: convert knfsd to kthread API Jeff Layton
2008-06-10 16:24         ` J. Bruce Fields
2008-06-10 16:25           ` J. Bruce Fields
2008-06-10 17:06             ` Jeff Layton
2008-06-10 20:05               ` J. Bruce Fields
2008-06-10 20:19                 ` 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=484E5C91.6000502@melbourne.sgi.com \
    --to=gnb-cp1dwlodopni96+mszhfpqc/g2k4zdhf@public.gmane.org \
    --cc=bfields@fieldses.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