diff options
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/fs.d/nfs/lib/thrpool.c | 37 | ||||
| -rw-r--r-- | usr/src/uts/common/rpc/svc.c | 33 |
2 files changed, 20 insertions, 50 deletions
diff --git a/usr/src/cmd/fs.d/nfs/lib/thrpool.c b/usr/src/cmd/fs.d/nfs/lib/thrpool.c index 8d79c6da20..bbab8613c6 100644 --- a/usr/src/cmd/fs.d/nfs/lib/thrpool.c +++ b/usr/src/cmd/fs.d/nfs/lib/thrpool.c @@ -46,21 +46,17 @@ svcstart(void *arg) { int id = (int)arg; - while (_nfssys(SVCPOOL_RUN, &id) < 0) { - /* - * Interrupted by a signal while in the kernel. - * this process is still alive, try again. - */ - if (errno == EINTR) - continue; - else - break; - } + /* + * Create a kernel worker thread to service + * new incoming requests on a pool. + */ + _nfssys(SVCPOOL_RUN, &id); /* - * If we weren't interrupted by a signal, but did - * return from the kernel, this thread's work is done, - * and it should exit. + * Returned from the kernel, this thread's work is done, + * and it should exit. For new incoming requests, + * svcblock() will spawn another worker thread by + * calling svcstart() again. */ thr_exit(NULL); return (NULL); @@ -102,14 +98,15 @@ svcblock(void *arg) * until a thread needs to be created. */ if (_nfssys(SVCPOOL_WAIT, &id) < 0) { - if (errno == ECANCELED || errno == EBUSY) + if (errno == ECANCELED || errno == EINTR || + errno == EBUSY) /* - * If we get back ECANCELED, the service - * pool is exiting, and we may as well - * clean up this thread. If EBUSY is - * returned, there's already a thread - * looping on this pool, so we should - * give up. + * If we get back ECANCELED or EINTR, + * the service pool is exiting, and we + * may as well clean up this thread. If + * EBUSY is returned, there's already a + * thread looping on this pool, so we + * should give up. */ break; else diff --git a/usr/src/uts/common/rpc/svc.c b/usr/src/uts/common/rpc/svc.c index d8844d3f59..5f40bbb4fb 100644 --- a/usr/src/uts/common/rpc/svc.c +++ b/usr/src/uts/common/rpc/svc.c @@ -36,8 +36,6 @@ * under license from the Regents of the University of California. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Server-side remote procedure call interface. * @@ -2079,7 +2077,7 @@ svc_poll(SVCPOOL *pool, SVCMASTERXPRT *xprt, SVCXPRT *clone_xprt) /* * If we received a signal while waiting for a * request, inform svc_run(), so that we can return - * to user level and restart the call. + * to user level and exit. */ if (timeleft == 0) return (SVC_EINTR); @@ -2114,7 +2112,6 @@ svc_run(SVCPOOL *pool) { SVCMASTERXPRT *xprt = NULL; /* master transport handle */ SVCXPRT *clone_xprt; /* clone for this thread */ - struct svc_globals *svc; proc_t *p = ttoproc(curthread); /* Allocate a clone transport handle for this thread */ @@ -2137,19 +2134,7 @@ svc_run(SVCPOOL *pool) */ if (p->p_flag & (SEXITING | SKILLED)) { svc_thread_exit(pool, clone_xprt); - - /* - * Thread has been interrupted and therefore - * the service daemon is leaving as well so - * let's go ahead and remove the service - * pool at this time. - */ - svc = zone_getspecific(svc_zone_key, curproc->p_zone); - mutex_enter(&svc->svc_plock); - svc_pool_unregister(svc, pool); - mutex_exit(&svc->svc_plock); - - return (0); + return (EINTR); } /* Find a transport with a pending request */ @@ -2182,22 +2167,10 @@ svc_run(SVCPOOL *pool) /* * Interrupted by a signal while waiting for a - * request. Return to userspace and restart. + * request. Return to userspace and exit. */ if (next == SVC_EINTR) { svc_thread_exit(pool, clone_xprt); - - /* - * Thread has been interrupted and therefore - * the service daemon is leaving as well so - * let's go ahead and remove the service - * pool at this time. - */ - svc = zone_getspecific(svc_zone_key, curproc->p_zone); - mutex_enter(&svc->svc_plock); - svc_pool_unregister(svc, pool); - mutex_exit(&svc->svc_plock); - return (EINTR); } |
