Lines Matching refs:pool

42 	SVC_POOL_GLOBAL,	/* no mapping, just a single global pool
44 SVC_POOL_PERCPU, /* one pool per cpu */
45 SVC_POOL_PERNODE /* one pool per numa node */
59 unsigned int *pool_to; /* maps pool id to cpu or node */
60 unsigned int *to_pool; /* maps cpu or node to pool id */
121 * Detect best pool mapping mode heuristically,
148 /* default: one global pool */
176 * Initialise the pool map for SVC_POOL_PERCPU mode.
204 * Initialise the pool map for SVC_POOL_PERNODE mode.
277 * freed; this allows the sysadmin to change the pool
314 * will only run on cpus in the given pool.
345 * Use the mapping mode to choose a pool for a given CPU.
347 * a non-NULL pool pointer.
471 struct svc_pool *pool = &serv->sv_pools[i];
473 dprintk("svc: initialising pool %u for %s\n",
476 pool->sp_id = i;
477 INIT_LIST_HEAD(&pool->sp_threads);
478 INIT_LIST_HEAD(&pool->sp_sockets);
479 INIT_LIST_HEAD(&pool->sp_all_threads);
480 spin_lock_init(&pool->sp_lock);
607 svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool, int node)
616 spin_lock_bh(&pool->sp_lock);
617 pool->sp_nrthreads++;
618 list_add(&rqstp->rq_all, &pool->sp_all_threads);
619 spin_unlock_bh(&pool->sp_lock);
621 rqstp->rq_pool = pool;
643 * Choose a pool in which to create a new thread, for svc_set_num_threads
646 choose_pool(struct svc_serv *serv, struct svc_pool *pool, unsigned int *state)
648 if (pool != NULL)
649 return pool;
658 choose_victim(struct svc_serv *serv, struct svc_pool *pool, unsigned int *state)
663 if (pool != NULL) {
664 spin_lock_bh(&pool->sp_lock);
666 /* choose a pool in round-robin fashion */
668 pool = &serv->sv_pools[--(*state) % serv->sv_nrpools];
669 spin_lock_bh(&pool->sp_lock);
670 if (!list_empty(&pool->sp_all_threads))
672 spin_unlock_bh(&pool->sp_lock);
678 if (!list_empty(&pool->sp_all_threads)) {
682 * Remove from the pool->sp_all_threads list
685 rqstp = list_entry(pool->sp_all_threads.next, struct svc_rqst, rq_all);
689 spin_unlock_bh(&pool->sp_lock);
696 * of threads the given number. If `pool' is non-NULL, applies
697 * only to threads in that pool, otherwise round-robins between
706 * to be pool-aware.
709 svc_set_num_threads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
718 if (pool == NULL) {
722 spin_lock_bh(&pool->sp_lock);
723 nrservs -= pool->sp_nrthreads;
724 spin_unlock_bh(&pool->sp_lock);
730 chosen_pool = choose_pool(serv, pool, &state);
758 (task = choose_victim(serv, pool, &state)) != NULL) {
775 struct svc_pool *pool = rqstp->rq_pool;
782 spin_lock_bh(&pool->sp_lock);
783 pool->sp_nrthreads--;
785 spin_unlock_bh(&pool->sp_lock);