Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cf4eb54 authored by Eric Dumazet's avatar Eric Dumazet Committed by Steffen Klassert
Browse files

xfrm: use vmalloc_node() for percpu scratches



scratches are per cpu, we can use vmalloc_node() for proper
NUMA affinity.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 5bf47256
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -220,8 +220,8 @@ static void ipcomp_free_scratches(void)


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


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


	for_each_possible_cpu(i) {
	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)
		if (!scratch)
			return NULL;
			return NULL;
		*per_cpu_ptr(scratches, i) = scratch;
		*per_cpu_ptr(scratches, i) = scratch;