From: "J. Bruce Fields" <bfields@fieldses.org>
To: Steve Dickson <SteveD@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [RFC PATCH] Using pthreads to handle upcalls.
Date: Mon, 9 Nov 2015 16:31:41 -0500 [thread overview]
Message-ID: <20151109213141.GD11046@fieldses.org> (raw)
In-Reply-To: <5640FDF2.9040802@RedHat.com>
On Mon, Nov 09, 2015 at 03:11:30PM -0500, Steve Dickson wrote:
> Hey,
>
> On 11/09/2015 01:39 PM, J. Bruce Fields wrote:
> > On Mon, Nov 09, 2015 at 08:05:07AM -0500, Steve Dickson wrote:
> >> Recently a bug was found that was causing a
> >> TGT fetch for every mount upcall. The bug was
> >> caused when forking for every mount was introduce.
> >> The global memory for the TGT cache was being
> >> freed when the forked process existed.
> >>
> >> The fix we came up with was to only fork on non-root
> >> upcalls, basically mount upcalls would no longer fork.
> >> In debugging the patch it became apparent that if the
> >> process hung, all NFS mounts on that client would be blocked.
> >> So at this point rpc.gssd is a single point of failure.
> >>
> >> This patch replaces the forking/non-forking with creating
> >> pthreads for every upcall which I think is a better
> >> solution to the original problem since pthreads can share
> >> global data.
> >
> > I seem to recall the reason for the fork is to allow dropping some
> > privileges while processing the upcall, is that right?
> I don't see this where privileges are being dropped.
See 6b53fc9ce38ba6fff2fd5c2f6ed143747067a39d "gssd: do a more thorough
change of identity after forking". I think the id's its switching there
are global to a process, not specific to a single pthread.
> >> I was also hoping using pthread would bring more asynchronous
> >> to rpc.gssd. I was thinking rpc.gssd could take an upcall,
> >> fire off a thread to handle it, the go back and listen
> >> for more upcalls.
> >>
> >> Unfortunately this is not the case. It seems, maybe due to
> >> my lack of my pthreads understanding, that after each
> >> pthread_create() call, a pthread_join() call, which waits for
> >> the created to stop, is needed. Similar to fork/wait..
> >
> > Actually making gssd thread-safe would be a significant effort.
> Is it because the MIT libs are not thread-safe?
I don't know, it's one of many things we'd need to check.
> Isn't the gssd_k5_kt_princ_list the only global list? Something to do
> with the upcalls?
There's also some global data that keeps track of the state of the rpc
pipefs directory--topdir_list, etc.
It might be easier just to share that one list? I don't know what would
be involved, though.
I'm not convinced this is a good way to help with hangs--a lot of the
cases that would cause a hang are going to cause further threads to hang
too.
I can believe the parallelism might be useful in some cases for
performance reasons, but I don't know if we've seen such a case yet.
--b.
prev parent reply other threads:[~2015-11-09 21:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 13:05 [RFC PATCH] Using pthreads to handle upcalls Steve Dickson
2015-11-09 13:05 ` [PATCH] gssd: use " Steve Dickson
2015-11-09 18:39 ` [RFC PATCH] Using " J. Bruce Fields
2015-11-09 20:11 ` Steve Dickson
2015-11-09 21:31 ` J. Bruce Fields [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=20151109213141.GD11046@fieldses.org \
--to=bfields@fieldses.org \
--cc=SteveD@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.