diff options
author | Greg Banks <gnb@melbourne.sgi.com> | 2006-10-02 05:18:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:20 -0400 |
commit | bfd241600a3b0db4fe43c859f1460d0a958d924a (patch) | |
tree | 7f04604adee7249e686d1db0cac93f1fee8bc5b6 /net/sunrpc/svcsock.c | |
parent | eec09661dc82e90a31051d045a94026a91aceb82 (diff) |
[PATCH] knfsd: make rpc threads pools numa aware
Actually implement multiple pools. On NUMA machines, allocate a svc_pool per
NUMA node; on SMP a svc_pool per CPU; otherwise a single global pool. Enqueue
sockets on the svc_pool corresponding to the CPU on which the socket bh is run
(i.e. the NIC interrupt CPU). Threads have their cpu mask set to limit them
to the CPUs in the svc_pool that owns them.
This is the patch that allows an Altix to scale NFS traffic linearly
beyond 4 CPUs and 4 NICs.
Incorporates changes and feedback from Neil Brown, Trond Myklebust, and
Christoph Hellwig.
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index b78659adeff3..cba85d195222 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -151,8 +151,9 @@ static void | |||
151 | svc_sock_enqueue(struct svc_sock *svsk) | 151 | svc_sock_enqueue(struct svc_sock *svsk) |
152 | { | 152 | { |
153 | struct svc_serv *serv = svsk->sk_server; | 153 | struct svc_serv *serv = svsk->sk_server; |
154 | struct svc_pool *pool = &serv->sv_pools[0]; | 154 | struct svc_pool *pool; |
155 | struct svc_rqst *rqstp; | 155 | struct svc_rqst *rqstp; |
156 | int cpu; | ||
156 | 157 | ||
157 | if (!(svsk->sk_flags & | 158 | if (!(svsk->sk_flags & |
158 | ( (1<<SK_CONN)|(1<<SK_DATA)|(1<<SK_CLOSE)|(1<<SK_DEFERRED)) )) | 159 | ( (1<<SK_CONN)|(1<<SK_DATA)|(1<<SK_CLOSE)|(1<<SK_DEFERRED)) )) |
@@ -160,6 +161,10 @@ svc_sock_enqueue(struct svc_sock *svsk) | |||
160 | if (test_bit(SK_DEAD, &svsk->sk_flags)) | 161 | if (test_bit(SK_DEAD, &svsk->sk_flags)) |
161 | return; | 162 | return; |
162 | 163 | ||
164 | cpu = get_cpu(); | ||
165 | pool = svc_pool_for_cpu(svsk->sk_server, cpu); | ||
166 | put_cpu(); | ||
167 | |||
163 | spin_lock_bh(&pool->sp_lock); | 168 | spin_lock_bh(&pool->sp_lock); |
164 | 169 | ||
165 | if (!list_empty(&pool->sp_threads) && | 170 | if (!list_empty(&pool->sp_threads) && |