Skip to content

Commit

Permalink
xfrm: use vmalloc_node() for percpu scratches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and Steffen Klassert committed Oct 21, 2013
1 parent 5bf4725 commit 5cf4eb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/xfrm/xfrm_ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static void ipcomp_free_scratches(void)

static void * __percpu *ipcomp_alloc_scratches(void)
{
int i;
void * __percpu *scratches;
int i;

if (ipcomp_scratch_users++)
return ipcomp_scratches;
Expand All @@ -233,7 +233,9 @@ static void * __percpu *ipcomp_alloc_scratches(void)
ipcomp_scratches = scratches;

for_each_possible_cpu(i) {
void *scratch = vmalloc(IPCOMP_SCRATCH_SIZE);
void *scratch;

scratch = vmalloc_node(IPCOMP_SCRATCH_SIZE, cpu_to_node(i));
if (!scratch)
return NULL;
*per_cpu_ptr(scratches, i) = scratch;
Expand Down

0 comments on commit 5cf4eb5

Please sign in to comment.