Author: rmacklem
Date: Mon Jul 30 19:23:52 2018
New Revision: 336927
URL: https://svnweb.freebsd.org/changeset/base/336927

Log:
  MFC: r335866
  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.

Modified:
  stable/11/sys/rpc/svc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/rpc/svc.c
==============================================================================
--- stable/11/sys/rpc/svc.c     Mon Jul 30 18:29:46 2018        (r336926)
+++ stable/11/sys/rpc/svc.c     Mon Jul 30 19:23:52 2018        (r336927)
@@ -1183,7 +1183,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;
 
                        /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to