All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] Using pthreads to handle upcalls.
@ 2015-11-09 13:05 Steve Dickson
  2015-11-09 13:05 ` [PATCH] gssd: use " Steve Dickson
  2015-11-09 18:39 ` [RFC PATCH] Using " J. Bruce Fields
  0 siblings, 2 replies; 5+ messages in thread
From: Steve Dickson @ 2015-11-09 13:05 UTC (permalink / raw)
  To: Linux NFS Mailing list

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 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..

This means if an upcall pthread gets hung the daemon
is also hung... The same single point of failure... 

I do believe using threads is a better solution than
the non-fork solution, but rpc.gssd is still a single 
point of failure. Plus I'm hoping moving to pthread will 
allow us to solve that problem.

Steve Dickson (1):
  gssd: use pthreads to handle upcalls

 aclocal/libpthread.m4  | 13 +++++++++++++
 configure.ac           |  3 +++
 utils/gssd/Makefile.am |  3 ++-
 utils/gssd/gssd.c      | 18 ++++++++++++++++--
 utils/gssd/gssd.h      |  2 ++
 utils/gssd/gssd_proc.c | 30 ------------------------------
 utils/gssd/krb5_util.c |  3 +++
 7 files changed, 39 insertions(+), 33 deletions(-)
 create mode 100644 aclocal/libpthread.m4

-- 
2.4.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-09 21:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.