* [PATCH] sunrpc: drop unneeded nrpools check in svc_pool_for_cpu()
@ 2026-07-08 12:00 Jeff Layton
2026-07-08 12:58 ` Chuck Lever
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2026-07-08 12:00 UTC (permalink / raw)
To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Trond Myklebust, Anna Schumaker
Cc: linux-nfs, linux-kernel, 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 that if() condition cannot be true."
Drop the useless check from this hotpath.
Suggested-by: NeilBrown <neil@brown.name>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
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(-)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 13d63f6b1d88..a098e1c13ca3 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -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,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] sunrpc: drop unneeded nrpools check in svc_pool_for_cpu()
2026-07-08 12:00 [PATCH] sunrpc: drop unneeded nrpools check in svc_pool_for_cpu() Jeff Layton
@ 2026-07-08 12:58 ` Chuck Lever
0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2026-07-08 12:58 UTC (permalink / raw)
To: Jeff Layton, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Trond Myklebust, Anna Schumaker
Cc: linux-nfs, linux-kernel
On Wed, Jul 8, 2026, at 8:00 AM, Jeff Layton wrote:
> 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 <neil@brown.name>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> Chuck, feel free to fold this into 5/5 of the pool_mode series.
Folded in to 5/5 and pushed out to nfsd-testing.
--
Chuck Lever
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-08 12:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 12:00 [PATCH] sunrpc: drop unneeded nrpools check in svc_pool_for_cpu() Jeff Layton
2026-07-08 12:58 ` Chuck Lever
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox