Lines Matching refs:pool

340 	SVCPOOL *pool;  in svc_zoneshutdown()  local
343 while ((pool = svc->svc_pools) != NULL) { in svc_zoneshutdown()
344 svc_pool_unregister(svc, pool); in svc_zoneshutdown()
379 svc_pool_cleanup(SVCPOOL *pool) in svc_pool_cleanup() argument
381 ASSERT(pool->p_threads + pool->p_detached_threads == 0); in svc_pool_cleanup()
382 ASSERT(pool->p_lcount == 0); in svc_pool_cleanup()
383 ASSERT(pool->p_closing); in svc_pool_cleanup()
390 if (pool->p_shutdown != NULL) in svc_pool_cleanup()
391 (pool->p_shutdown)(); in svc_pool_cleanup()
394 svc_xprt_qdestroy(pool); in svc_pool_cleanup()
397 rw_destroy(&pool->p_lrwlock); in svc_pool_cleanup()
400 mutex_destroy(&pool->p_thread_lock); in svc_pool_cleanup()
401 mutex_destroy(&pool->p_req_lock); in svc_pool_cleanup()
402 cv_destroy(&pool->p_req_cv); in svc_pool_cleanup()
405 mutex_destroy(&pool->p_creator_lock); in svc_pool_cleanup()
406 cv_destroy(&pool->p_creator_cv); in svc_pool_cleanup()
407 mutex_destroy(&pool->p_user_lock); in svc_pool_cleanup()
408 cv_destroy(&pool->p_user_cv); in svc_pool_cleanup()
411 kmem_free(pool, sizeof (SVCPOOL)); in svc_pool_cleanup()
419 svc_pool_tryexit(SVCPOOL *pool) in svc_pool_tryexit() argument
421 ASSERT(MUTEX_HELD(&pool->p_thread_lock)); in svc_pool_tryexit()
422 ASSERT(pool->p_closing); in svc_pool_tryexit()
424 if (pool->p_threads + pool->p_detached_threads == 0) { in svc_pool_tryexit()
425 rw_enter(&pool->p_lrwlock, RW_READER); in svc_pool_tryexit()
426 if (pool->p_lcount == 0) { in svc_pool_tryexit()
430 rw_exit(&pool->p_lrwlock); in svc_pool_tryexit()
431 mutex_exit(&pool->p_thread_lock); in svc_pool_tryexit()
439 ASSERT(!MUTEX_HELD(&pool->p_thread_lock)); in svc_pool_tryexit()
440 svc_creator_signalexit(pool); in svc_pool_tryexit()
444 rw_exit(&pool->p_lrwlock); in svc_pool_tryexit()
447 ASSERT(MUTEX_HELD(&pool->p_thread_lock)); in svc_pool_tryexit()
457 SVCPOOL *pool; in svc_pool_find() local
465 for (pool = svc->svc_pools; pool; pool = pool->p_next) in svc_pool_find()
466 if (pool->p_id == id) in svc_pool_find()
467 return (pool); in svc_pool_find()
481 SVCPOOL *pool; in svc_do_run() local
488 pool = svc_pool_find(svc, id); in svc_do_run()
492 if (pool == NULL) in svc_do_run()
499 mutex_enter(&pool->p_thread_lock); in svc_do_run()
500 pool->p_threads++; in svc_do_run()
501 mutex_exit(&pool->p_thread_lock); in svc_do_run()
504 err = svc_run(pool); in svc_do_run()
515 svc_pool_unregister(struct svc_globals *svc, SVCPOOL *pool) in svc_pool_unregister() argument
517 SVCPOOL *next = pool->p_next; in svc_pool_unregister()
518 SVCPOOL *prev = pool->p_prev; in svc_pool_unregister()
523 if (pool == svc->svc_pools) in svc_pool_unregister()
529 pool->p_next = pool->p_prev = NULL; in svc_pool_unregister()
536 mutex_enter(&pool->p_thread_lock); in svc_pool_unregister()
537 if (pool->p_offline != NULL) in svc_pool_unregister()
538 (pool->p_offline)(); in svc_pool_unregister()
539 pool->p_closing = TRUE; in svc_pool_unregister()
540 if (svc_pool_tryexit(pool)) in svc_pool_unregister()
542 mutex_exit(&pool->p_thread_lock); in svc_pool_unregister()
551 svc_pool_register(struct svc_globals *svc, SVCPOOL *pool, int id) in svc_pool_register() argument
565 pool->p_id = id; in svc_pool_register()
566 pool->p_next = svc->svc_pools; in svc_pool_register()
567 pool->p_prev = NULL; in svc_pool_register()
569 svc->svc_pools->p_prev = pool; in svc_pool_register()
570 svc->svc_pools = pool; in svc_pool_register()
579 svc_pool_init(SVCPOOL *pool, uint_t maxthreads, uint_t redline, in svc_pool_init() argument
584 ASSERT(pool); in svc_pool_init()
603 svc_xprt_qinit(pool, qsize); in svc_pool_init()
606 rw_init(&pool->p_lrwlock, NULL, RW_DEFAULT, NULL); in svc_pool_init()
619 pool->p_maxthreads = maxthreads; in svc_pool_init()
620 pool->p_redline = redline; in svc_pool_init()
621 pool->p_timeout = timeout * hz; in svc_pool_init()
622 pool->p_stksize = stksize; in svc_pool_init()
623 pool->p_max_same_xprt = max_same_xprt; in svc_pool_init()
624 mutex_init(&pool->p_thread_lock, NULL, MUTEX_DEFAULT, NULL); in svc_pool_init()
625 mutex_init(&pool->p_req_lock, NULL, MUTEX_DEFAULT, NULL); in svc_pool_init()
626 cv_init(&pool->p_req_cv, NULL, CV_DEFAULT, NULL); in svc_pool_init()
629 pool->p_user_exit = FALSE; in svc_pool_init()
630 pool->p_signal_create_thread = FALSE; in svc_pool_init()
631 pool->p_user_waiting = FALSE; in svc_pool_init()
632 mutex_init(&pool->p_user_lock, NULL, MUTEX_DEFAULT, NULL); in svc_pool_init()
633 cv_init(&pool->p_user_cv, NULL, CV_DEFAULT, NULL); in svc_pool_init()
636 pool->p_creator_exit = FALSE; in svc_pool_init()
637 mutex_init(&pool->p_creator_lock, NULL, MUTEX_DEFAULT, NULL); in svc_pool_init()
638 cv_init(&pool->p_creator_cv, NULL, CV_DEFAULT, NULL); in svc_pool_init()
640 (void) zthread_create(NULL, pool->p_stksize, svc_thread_creator, in svc_pool_init()
641 pool, 0, minclsyspri); in svc_pool_init()
662 SVCPOOL *pool; in svc_pool_create() local
673 pool = kmem_zalloc(sizeof (SVCPOOL), KM_SLEEP); in svc_pool_create()
678 error = svc_pool_init(pool, args->maxthreads, args->redline, in svc_pool_create()
682 kmem_free(pool, sizeof (SVCPOOL)); in svc_pool_create()
687 svc_pool_register(svc, pool, args->id); in svc_pool_create()
695 SVCPOOL *pool; in svc_pool_control() local
708 if ((pool = svc_pool_find(svc, id)) == NULL) { in svc_pool_control()
716 rw_enter(&pool->p_lrwlock, RW_WRITER); in svc_pool_control()
719 pool->p_shutdown = *((void (*)())arg); in svc_pool_control()
721 rw_exit(&pool->p_lrwlock); in svc_pool_control()
731 if ((pool = svc_pool_find(svc, id)) == NULL) { in svc_pool_control()
739 rw_enter(&pool->p_lrwlock, RW_WRITER); in svc_pool_control()
742 pool->p_offline = *((void (*)())arg); in svc_pool_control()
744 rw_exit(&pool->p_lrwlock); in svc_pool_control()
769 SVCPOOL *pool; in svc_xprt_register() local
779 if ((pool = svc_pool_find(svc, id)) == NULL) { in svc_xprt_register()
785 rw_enter(&pool->p_lrwlock, RW_WRITER); in svc_xprt_register()
789 if (pool->p_closing) { in svc_xprt_register()
790 rw_exit(&pool->p_lrwlock); in svc_xprt_register()
798 xprt->xp_pool = pool; in svc_xprt_register()
804 if (pool->p_lhead == NULL) in svc_xprt_register()
805 pool->p_lhead = xprt->xp_prev = xprt->xp_next = xprt; in svc_xprt_register()
807 next = pool->p_lhead; in svc_xprt_register()
808 prev = pool->p_lhead->xp_prev; in svc_xprt_register()
813 pool->p_lhead = prev->xp_next = next->xp_prev = xprt; in svc_xprt_register()
817 pool->p_lcount++; in svc_xprt_register()
819 rw_exit(&pool->p_lrwlock); in svc_xprt_register()
831 SVCPOOL *pool = xprt->xp_pool; in svc_xprt_unregister() local
839 rw_enter(&pool->p_lrwlock, RW_WRITER); in svc_xprt_unregister()
842 pool->p_lhead = NULL; in svc_xprt_unregister()
850 if (pool->p_lhead == xprt) in svc_xprt_unregister()
851 pool->p_lhead = next; in svc_xprt_unregister()
857 pool->p_lcount--; in svc_xprt_unregister()
859 rw_exit(&pool->p_lrwlock); in svc_xprt_unregister()
863 svc_xprt_qdestroy(SVCPOOL *pool) in svc_xprt_qdestroy() argument
865 mutex_destroy(&pool->p_qend_lock); in svc_xprt_qdestroy()
866 kmem_free(pool->p_qbody, pool->p_qsize * sizeof (__SVCXPRT_QNODE)); in svc_xprt_qdestroy()
873 svc_xprt_qinit(SVCPOOL *pool, size_t qsize) in svc_xprt_qinit() argument
877 pool->p_qsize = qsize; in svc_xprt_qinit()
878 pool->p_qbody = kmem_zalloc(pool->p_qsize * sizeof (__SVCXPRT_QNODE), in svc_xprt_qinit()
881 for (i = 0; i < pool->p_qsize - 1; i++) in svc_xprt_qinit()
882 pool->p_qbody[i].q_next = &(pool->p_qbody[i+1]); in svc_xprt_qinit()
884 pool->p_qbody[pool->p_qsize-1].q_next = &(pool->p_qbody[0]); in svc_xprt_qinit()
885 pool->p_qtop = &(pool->p_qbody[0]); in svc_xprt_qinit()
886 pool->p_qend = &(pool->p_qbody[0]); in svc_xprt_qinit()
888 mutex_init(&pool->p_qend_lock, NULL, MUTEX_DEFAULT, NULL); in svc_xprt_qinit()
901 svc_xprt_qput(SVCPOOL *pool, SVCMASTERXPRT *xprt) in svc_xprt_qput() argument
903 ASSERT(MUTEX_HELD(&pool->p_req_lock)); in svc_xprt_qput()
906 if (pool->p_qoverflow) in svc_xprt_qput()
910 if (pool->p_qtop->q_next == pool->p_qend) { in svc_xprt_qput()
911 mutex_enter(&pool->p_qend_lock); in svc_xprt_qput()
912 if (pool->p_qtop->q_next == pool->p_qend) { in svc_xprt_qput()
913 pool->p_qoverflow = TRUE; in svc_xprt_qput()
914 mutex_exit(&pool->p_qend_lock); in svc_xprt_qput()
917 mutex_exit(&pool->p_qend_lock); in svc_xprt_qput()
921 pool->p_qtop->q_xprt = xprt; in svc_xprt_qput()
922 pool->p_qtop = pool->p_qtop->q_next; in svc_xprt_qput()
936 svc_xprt_qget(SVCPOOL *pool) in svc_xprt_qget() argument
940 mutex_enter(&pool->p_qend_lock); in svc_xprt_qget()
949 if (pool->p_qend == pool->p_qtop) { in svc_xprt_qget()
950 mutex_exit(&pool->p_qend_lock); in svc_xprt_qget()
955 xprt = pool->p_qend->q_xprt; in svc_xprt_qget()
956 pool->p_qend = pool->p_qend->q_next; in svc_xprt_qget()
960 mutex_exit(&pool->p_qend_lock); in svc_xprt_qget()
971 svc_xprt_qdelete(SVCPOOL *pool, SVCMASTERXPRT *xprt) in svc_xprt_qdelete() argument
975 mutex_enter(&pool->p_req_lock); in svc_xprt_qdelete()
976 for (q = pool->p_qend; q != pool->p_qtop; q = q->q_next) { in svc_xprt_qdelete()
980 mutex_exit(&pool->p_req_lock); in svc_xprt_qdelete()
1564 svc_thread_exit(SVCPOOL *pool, SVCXPRT *clone_xprt) in svc_thread_exit() argument
1570 mutex_enter(&pool->p_thread_lock); in svc_thread_exit()
1571 pool->p_threads--; in svc_thread_exit()
1572 if (pool->p_closing && svc_pool_tryexit(pool)) in svc_thread_exit()
1575 mutex_exit(&pool->p_thread_lock); in svc_thread_exit()
1591 svc_thread_exitdetached(SVCPOOL *pool, SVCXPRT *clone_xprt) in svc_thread_exitdetached() argument
1596 ASSERT(!MUTEX_HELD(&pool->p_thread_lock)); in svc_thread_exitdetached()
1601 mutex_enter(&pool->p_thread_lock); in svc_thread_exitdetached()
1603 ASSERT(pool->p_reserved_threads >= 0); in svc_thread_exitdetached()
1604 ASSERT(pool->p_detached_threads > 0); in svc_thread_exitdetached()
1606 pool->p_detached_threads--; in svc_thread_exitdetached()
1607 if (pool->p_closing && svc_pool_tryexit(pool)) in svc_thread_exitdetached()
1610 mutex_exit(&pool->p_thread_lock); in svc_thread_exitdetached()
1624 SVCPOOL *pool; in svc_wait() local
1630 pool = svc_pool_find(svc, id); in svc_wait()
1633 if (pool == NULL) in svc_wait()
1636 mutex_enter(&pool->p_user_lock); in svc_wait()
1639 if (pool->p_user_waiting) { in svc_wait()
1640 mutex_exit(&pool->p_user_lock); in svc_wait()
1644 pool->p_user_waiting = TRUE; in svc_wait()
1647 while (!pool->p_signal_create_thread && !pool->p_user_exit) { in svc_wait()
1648 if (cv_wait_sig(&pool->p_user_cv, &pool->p_user_lock) == 0) { in svc_wait()
1650 pool->p_user_waiting = FALSE; in svc_wait()
1651 pool->p_signal_create_thread = FALSE; in svc_wait()
1652 mutex_exit(&pool->p_user_lock); in svc_wait()
1661 svc_pool_unregister(svc, pool); in svc_wait()
1668 pool->p_signal_create_thread = FALSE; in svc_wait()
1669 pool->p_user_waiting = FALSE; in svc_wait()
1677 if (pool->p_user_exit) { in svc_wait()
1679 cv_signal(&pool->p_user_cv); in svc_wait()
1682 mutex_exit(&pool->p_user_lock); in svc_wait()
1693 svc_thread_creator(SVCPOOL *pool) in svc_thread_creator() argument
1697 CALLB_CPR_INIT(&cpr_info, &pool->p_creator_lock, callb_generic_cpr, in svc_thread_creator()
1701 mutex_enter(&pool->p_creator_lock); in svc_thread_creator()
1704 if (pool->p_creator_exit) in svc_thread_creator()
1708 pool->p_creator_signaled = FALSE; in svc_thread_creator()
1711 cv_wait(&pool->p_creator_cv, &pool->p_creator_lock); in svc_thread_creator()
1712 CALLB_CPR_SAFE_END(&cpr_info, &pool->p_creator_lock); in svc_thread_creator()
1715 if (pool->p_creator_exit) in svc_thread_creator()
1718 mutex_exit(&pool->p_creator_lock); in svc_thread_creator()
1720 mutex_enter(&pool->p_thread_lock); in svc_thread_creator()
1726 if (pool->p_closing) { in svc_thread_creator()
1727 rw_enter(&pool->p_lrwlock, RW_READER); in svc_thread_creator()
1728 if (pool->p_lcount == 0) { in svc_thread_creator()
1729 rw_exit(&pool->p_lrwlock); in svc_thread_creator()
1730 mutex_exit(&pool->p_thread_lock); in svc_thread_creator()
1733 rw_exit(&pool->p_lrwlock); in svc_thread_creator()
1739 ASSERT(pool->p_reserved_threads >= 0); in svc_thread_creator()
1740 ASSERT(pool->p_detached_threads >= 0); in svc_thread_creator()
1742 if (pool->p_threads + pool->p_detached_threads < in svc_thread_creator()
1743 pool->p_maxthreads) { in svc_thread_creator()
1748 mutex_enter(&pool->p_user_lock); in svc_thread_creator()
1749 if (pool->p_signal_create_thread == FALSE) { in svc_thread_creator()
1750 pool->p_signal_create_thread = TRUE; in svc_thread_creator()
1751 cv_signal(&pool->p_user_cv); in svc_thread_creator()
1753 mutex_exit(&pool->p_user_lock); in svc_thread_creator()
1757 mutex_exit(&pool->p_thread_lock); in svc_thread_creator()
1765 mutex_enter(&pool->p_user_lock); in svc_thread_creator()
1766 pool->p_user_exit = TRUE; in svc_thread_creator()
1767 cv_broadcast(&pool->p_user_cv); in svc_thread_creator()
1768 mutex_exit(&pool->p_user_lock); in svc_thread_creator()
1771 mutex_enter(&pool->p_user_lock); in svc_thread_creator()
1772 while (pool->p_user_waiting) { in svc_thread_creator()
1774 cv_wait(&pool->p_user_cv, &pool->p_user_lock); in svc_thread_creator()
1775 CALLB_CPR_SAFE_END(&cpr_info, &pool->p_creator_lock); in svc_thread_creator()
1777 mutex_exit(&pool->p_user_lock); in svc_thread_creator()
1780 svc_pool_cleanup(pool); in svc_thread_creator()
1789 svc_creator_signal(SVCPOOL *pool) in svc_creator_signal() argument
1791 mutex_enter(&pool->p_creator_lock); in svc_creator_signal()
1792 if (pool->p_creator_signaled == FALSE) { in svc_creator_signal()
1793 pool->p_creator_signaled = TRUE; in svc_creator_signal()
1794 cv_signal(&pool->p_creator_cv); in svc_creator_signal()
1796 mutex_exit(&pool->p_creator_lock); in svc_creator_signal()
1803 svc_creator_signalexit(SVCPOOL *pool) in svc_creator_signalexit() argument
1805 mutex_enter(&pool->p_creator_lock); in svc_creator_signalexit()
1806 pool->p_creator_exit = TRUE; in svc_creator_signalexit()
1807 cv_signal(&pool->p_creator_cv); in svc_creator_signalexit()
1808 mutex_exit(&pool->p_creator_lock); in svc_creator_signalexit()
1822 svc_poll(SVCPOOL *pool, SVCMASTERXPRT *xprt, SVCXPRT *clone_xprt) in svc_poll() argument
1851 if (xprt && xprt->xp_req_head && (!pool->p_qoverflow || in svc_poll()
1852 clone_xprt->xp_same_xprt++ < pool->p_max_same_xprt)) { in svc_poll()
1865 mutex_enter(&pool->p_req_lock); in svc_poll()
1866 pool->p_walkers++; in svc_poll()
1867 mutex_exit(&pool->p_req_lock); in svc_poll()
1873 rw_enter(&pool->p_lrwlock, RW_READER); in svc_poll()
1889 hint = svc_xprt_qget(pool); in svc_poll()
1894 rw_exit(&pool->p_lrwlock); in svc_poll()
1896 mutex_enter(&pool->p_req_lock); in svc_poll()
1897 pool->p_walkers--; in svc_poll()
1898 mutex_exit(&pool->p_req_lock); in svc_poll()
1914 if (pool->p_reqs < pool->p_walkers) { in svc_poll()
1915 mutex_enter(&pool->p_req_lock); in svc_poll()
1916 if (pool->p_reqs < pool->p_walkers) in svc_poll()
1918 mutex_exit(&pool->p_req_lock); in svc_poll()
1920 if (pool->p_qoverflow) { in svc_poll()
1937 if (xprt == NULL && pool->p_lhead == NULL) { in svc_poll()
1938 mutex_enter(&pool->p_req_lock); in svc_poll()
1947 next = xprt ? xprt->xp_next : pool->p_lhead; in svc_poll()
1964 rw_exit(&pool->p_lrwlock); in svc_poll()
1966 mutex_enter(&pool->p_req_lock); in svc_poll()
1967 pool->p_walkers--; in svc_poll()
1968 mutex_exit(&pool->p_req_lock); in svc_poll()
1981 if (pool->p_reqs < pool->p_walkers) { in svc_poll()
1983 mutex_enter(&pool->p_req_lock); in svc_poll()
1984 if (pool->p_reqs < pool->p_walkers) in svc_poll()
1986 mutex_exit(&pool->p_req_lock); in svc_poll()
1997 pool->p_walkers--; in svc_poll()
1998 rw_exit(&pool->p_lrwlock); in svc_poll()
2004 pool->p_asleep++; in svc_poll()
2005 timeleft = cv_reltimedwait_sig(&pool->p_req_cv, in svc_poll()
2006 &pool->p_req_lock, pool->p_timeout, TR_CLOCK_TICK); in svc_poll()
2017 if (pool->p_drowsy) { in svc_poll()
2018 pool->p_drowsy = FALSE; in svc_poll()
2027 pool->p_asleep--; in svc_poll()
2029 mutex_exit(&pool->p_req_lock); in svc_poll()
2140 SVCPOOL *pool = xprt->xp_pool; in svc_flowcontrol() local
2142 int enough_reqs = pool->p_maxthreads * pool->p_max_same_xprt; in svc_flowcontrol()
2162 if (pool->p_size >= totalmem / 5 && in svc_flowcontrol()
2163 xprt->xp_size >= totalmem / 5 / pool->p_lcount) in svc_flowcontrol()
2179 if (pool->p_size >= totalmem / 6 && in svc_flowcontrol()
2180 xprt->xp_size >= totalmem / 5 / pool->p_lcount / 2) in svc_flowcontrol()
2198 svc_run(SVCPOOL *pool) in svc_run() argument
2225 svc_thread_exit(pool, clone_xprt); in svc_run()
2230 next = svc_poll(pool, xprt, clone_xprt); in svc_run()
2253 svc_thread_exit(pool, clone_xprt); in svc_run()
2262 svc_thread_exit(pool, clone_xprt); in svc_run()
2275 mutex_enter(&pool->p_req_lock); in svc_run()
2276 pool->p_reqs--; in svc_run()
2277 if (pool->p_reqs == 0) in svc_run()
2278 pool->p_qoverflow = FALSE; in svc_run()
2279 pool->p_size -= size; in svc_run()
2280 mutex_exit(&pool->p_req_lock); in svc_run()
2289 "rpc_que_req_deq:pool %p mp %p", pool, mp); in svc_run()
2314 if (!(pool->p_drowsy || pool->p_reqs <= pool->p_walkers || in svc_run()
2315 pool->p_asleep == 0)) { in svc_run()
2316 mutex_enter(&pool->p_req_lock); in svc_run()
2318 if (pool->p_drowsy || pool->p_reqs <= pool->p_walkers || in svc_run()
2319 pool->p_asleep == 0) in svc_run()
2320 mutex_exit(&pool->p_req_lock); in svc_run()
2322 pool->p_asleep--; in svc_run()
2323 pool->p_drowsy = TRUE; in svc_run()
2325 cv_signal(&pool->p_req_cv); in svc_run()
2326 mutex_exit(&pool->p_req_lock); in svc_run()
2340 if (pool->p_asleep == 0 && !pool->p_drowsy && in svc_run()
2341 pool->p_threads + pool->p_detached_threads < in svc_run()
2342 pool->p_maxthreads) in svc_run()
2343 svc_creator_signal(pool); in svc_run()
2359 svc_thread_exitdetached(pool, clone_xprt); in svc_run()
2386 SVCPOOL *pool; in svc_queueclean() local
2392 pool = xprt->xp_pool; in svc_queueclean()
2400 mutex_enter(&pool->p_req_lock); in svc_queueclean()
2401 pool->p_reqs -= xprt->xp_reqs; in svc_queueclean()
2402 pool->p_size -= xprt->xp_size; in svc_queueclean()
2403 mutex_exit(&pool->p_req_lock); in svc_queueclean()
2447 SVCPOOL *pool = xprt->xp_pool; in svc_queueclose() local
2455 mutex_enter(&pool->p_thread_lock); in svc_queueclose()
2462 if (pool->p_closing && svc_pool_tryexit(pool)) { in svc_queueclose()
2465 mutex_exit(&pool->p_thread_lock); in svc_queueclose()
2501 SVCPOOL *pool = xprt->xp_pool; in svc_queuereq() local
2525 mutex_enter(&pool->p_req_lock); in svc_queuereq()
2540 svc_xprt_qput(pool, xprt); in svc_queuereq()
2543 pool->p_reqs++; in svc_queuereq()
2548 pool->p_size += size; in svc_queuereq()
2555 "rpc_que_req_enq:pool %p mp %p", pool, mp); in svc_queuereq()
2565 if (pool->p_drowsy || pool->p_reqs <= pool->p_walkers || in svc_queuereq()
2566 pool->p_asleep == 0) { in svc_queuereq()
2567 mutex_exit(&pool->p_req_lock); in svc_queuereq()
2569 pool->p_drowsy = TRUE; in svc_queuereq()
2570 pool->p_asleep--; in svc_queuereq()
2575 cv_signal(&pool->p_req_cv); in svc_queuereq()
2576 mutex_exit(&pool->p_req_lock); in svc_queuereq()
2591 if (pool->p_asleep == 0 && !pool->p_drowsy && in svc_queuereq()
2592 pool->p_threads + pool->p_detached_threads < pool->p_maxthreads) in svc_queuereq()
2593 svc_creator_signal(pool); in svc_queuereq()
2620 SVCPOOL *pool = clone_xprt->xp_master->xp_pool; in svc_reserve_thread() local
2627 mutex_enter(&pool->p_thread_lock); in svc_reserve_thread()
2628 if (pool->p_reserved_threads + pool->p_detached_threads >= in svc_reserve_thread()
2629 pool->p_maxthreads - pool->p_redline) { in svc_reserve_thread()
2630 mutex_exit(&pool->p_thread_lock); in svc_reserve_thread()
2633 pool->p_reserved_threads++; in svc_reserve_thread()
2634 mutex_exit(&pool->p_thread_lock); in svc_reserve_thread()
2650 SVCPOOL *pool = clone_xprt->xp_master->xp_pool; in svc_unreserve_thread() local
2657 mutex_enter(&pool->p_thread_lock); in svc_unreserve_thread()
2658 pool->p_reserved_threads--; in svc_unreserve_thread()
2659 mutex_exit(&pool->p_thread_lock); in svc_unreserve_thread()
2688 SVCPOOL *pool = xprt->xp_pool; in svc_detach_thread() local
2702 mutex_enter(&pool->p_thread_lock); in svc_detach_thread()
2703 pool->p_threads--; in svc_detach_thread()
2704 pool->p_reserved_threads--; in svc_detach_thread()
2705 pool->p_detached_threads++; in svc_detach_thread()
2706 mutex_exit(&pool->p_thread_lock); in svc_detach_thread()
2740 SVCPOOL *pool; in rdma_stop() local
2757 pool = xprt->xp_pool; in rdma_stop()
2769 mutex_enter(&pool->p_req_lock); in rdma_stop()
2770 pool->p_reqs -= xprt->xp_reqs; in rdma_stop()
2771 pool->p_size -= xprt->xp_size; in rdma_stop()
2772 mutex_exit(&pool->p_req_lock); in rdma_stop()