Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2018 17:50:47 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335866 - head/sys/rpc
Message-ID:  <201807021750.w62HolqB057525@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Mon Jul  2 17:50:46 2018
New Revision: 335866
URL: https://svnweb.freebsd.org/changeset/base/335866

Log:
  Fix the server side krpc so that the kernel nfsd threads terminate.
  
  Occationally the kernel nfsd threads would not terminate when a SIGKILL
  was posted for the kernel process (called nfsd (slave)). When this occurred,
  the thread associated with the process (called "ismaster") had returned from
  svc_run_internal() and was sleeping waiting for the other threads to terminate.
  The other threads (created by kthread_start()) were still in svc_run_internal()
  handling NFS RPCs.
  The only way this could occur is for the "ismaster" thread to return from
  svc_run_internal() without having called svc_exit().
  There was only one place in the code where this could happen and this patch
  stops that from happening.
  Since the problem is intermittent, I cannot be sure if this has fixed the
  problem, but I have not seen an occurrence of the problem with this patch
  applied.
  
  Reviewed by:	kib
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D16087

Modified:
  head/sys/rpc/svc.c

Modified: head/sys/rpc/svc.c
==============================================================================
--- head/sys/rpc/svc.c	Mon Jul  2 17:18:46 2018	(r335865)
+++ head/sys/rpc/svc.c	Mon Jul  2 17:50:46 2018	(r335866)
@@ -1185,7 +1185,8 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster)
 			/*
 			 * Enforce maxthreads count.
 			 */
-			if (grp->sg_threadcount > grp->sg_maxthreads)
+			if (!ismaster && grp->sg_threadcount >
+			    grp->sg_maxthreads)
 				break;
 
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807021750.w62HolqB057525>