sunrpc: drop unneeded nrpools check in svc_pool_for_cpu()
Subsystems (3)
Jeff Layton
maintainerPATCH 1/1 sunrpc: drop unneeded nrpools check in svc_pool_for_cpu()
As Neil pointed out in review:
"The values stored in svc_pool_map.to_pool are all less than
svc_pool_map.npools. So that if() condition cannot be true."
Drop the useless check from this hotpath.
Suggested-by NeilBrown <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
---
Chuck, feel free to fold this into 5/5 of the pool_mode series.
--- net/sunrpc/svc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/sunrpc/svc.c +1 -4
@@ -269,10 +269,6 @@ struct svc_pool *svc_pool_for_cpu(struct svc_serv *serv)if (nrpools <=1 )return serv->sv_pools; - pidx = m->to_pool[cpu_to_node (raw_smp_processor_id ())]; -if (pidx >= nrpools) - pidx =0 ; -/* * It's possible to have a pool with no threads. Userland can just set * things up this way directly. Also, when threads are autodistributed
@@ -284,6 +280,7 @@ struct svc_pool *svc_pool_for_cpu(struct svc_serv *serv)* populated pool, trading NUMA locality for a guarantee that the * transport is serviced. */ + pidx = m->to_pool[cpu_to_node (raw_smp_processor_id ())];for (i =0 ; i < nrpools; i++) {struct svc_pool *pool = &serv->sv_pools[pidx];
---
base-commit: 9435623ac560654825a62ee4b628ae4bbaa87920
change-id: 20260708-pool-mode-2f6e2d652174
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Chuck Lever
maintainerQuoted 11 lines · Jeff Layton
As Neil pointed out in review:
"The values stored in svc_pool_map.to_pool are all less than
svc_pool_map.npools. So thatif()condition cannot be true."Drop the useless check from this hotpath.
Suggested-by NeilBrown <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
Chuck, feel free to fold this into 5/5 of thepool_modeseries.
Folded in to 5/5 and pushed out to nfsd-testing.
Signature · 1 line
Chuck Lever