diff options
author | Eric Dumazet <edumazet@google.com> | 2013-10-18 06:54:16 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2013-10-21 03:38:24 -0400 |
commit | 5cf4eb54c2dcae681279a9cfca5498cfe65c5384 (patch) | |
tree | aecae983bb2a2fc45a549f4168eb2e69991edba7 /net/xfrm | |
parent | 5bf47256f5433a9a5782754664e5ea04acb0537d (diff) |
xfrm: use vmalloc_node() for percpu scratches
scratches are per cpu, we can use vmalloc_node() for proper
NUMA affinity.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_ipcomp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 2906d520eea7..b943c7fc5ed2 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c | |||
@@ -220,8 +220,8 @@ static void ipcomp_free_scratches(void) | |||
220 | 220 | ||
221 | static void * __percpu *ipcomp_alloc_scratches(void) | 221 | static void * __percpu *ipcomp_alloc_scratches(void) |
222 | { | 222 | { |
223 | int i; | ||
224 | void * __percpu *scratches; | 223 | void * __percpu *scratches; |
224 | int i; | ||
225 | 225 | ||
226 | if (ipcomp_scratch_users++) | 226 | if (ipcomp_scratch_users++) |
227 | return ipcomp_scratches; | 227 | return ipcomp_scratches; |
@@ -233,7 +233,9 @@ static void * __percpu *ipcomp_alloc_scratches(void) | |||
233 | ipcomp_scratches = scratches; | 233 | ipcomp_scratches = scratches; |
234 | 234 | ||
235 | for_each_possible_cpu(i) { | 235 | for_each_possible_cpu(i) { |
236 | void *scratch = vmalloc(IPCOMP_SCRATCH_SIZE); | 236 | void *scratch; |
237 | |||
238 | scratch = vmalloc_node(IPCOMP_SCRATCH_SIZE, cpu_to_node(i)); | ||
237 | if (!scratch) | 239 | if (!scratch) |
238 | return NULL; | 240 | return NULL; |
239 | *per_cpu_ptr(scratches, i) = scratch; | 241 | *per_cpu_ptr(scratches, i) = scratch; |