Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Dumazet and committed by
Steffen Klassert
5cf4eb54 5bf47256

+4 -2
+4 -2
net/xfrm/xfrm_ipcomp.c
··· 220 220 221 221 static void * __percpu *ipcomp_alloc_scratches(void) 222 222 { 223 - int i; 224 223 void * __percpu *scratches; 224 + int i; 225 225 226 226 if (ipcomp_scratch_users++) 227 227 return ipcomp_scratches; ··· 233 233 ipcomp_scratches = scratches; 234 234 235 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 239 if (!scratch) 238 240 return NULL; 239 241 *per_cpu_ptr(scratches, i) = scratch;