diff mbox

[net-next] ipv6: add NUMA awareness to seg6_hmac_init_algo()

Message ID 1484928536.16328.127.camel@edumazet-glaptop3.roam.corp.google.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Jan. 20, 2017, 4:08 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

Since we allocate per cpu storage, let's also use NUMA hints.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/seg6_hmac.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Lebrun Jan. 21, 2017, 12:18 p.m. UTC | #1
On 01/20/2017 05:08 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Since we allocate per cpu storage, let's also use NUMA hints.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/ipv6/seg6_hmac.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c
> index 5215e1eba01030dc9345b847eee5ac5ef3bed1b9..b274f1d95e037c93e8e0e6531cfc51709f71297c 100644
> --- a/net/ipv6/seg6_hmac.c
> +++ b/net/ipv6/seg6_hmac.c
> @@ -389,7 +389,8 @@ static int seg6_hmac_init_algo(void)
>  			return -ENOMEM;
>  
>  		for_each_possible_cpu(cpu) {
> -			shash = kzalloc(shsize, GFP_KERNEL);
> +			shash = kzalloc_node(shsize, GFP_KERNEL,
> +					     cpu_to_node(cpu));
>  			if (!shash)
>  				return -ENOMEM;
>  			*per_cpu_ptr(algo->shashs, cpu) = shash;
> 
> 

Thanks

Acked-by: David Lebrun <david.lebrun@uclouvain.be>
David Miller Jan. 22, 2017, 9:50 p.m. UTC | #2
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 20 Jan 2017 08:08:56 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> Since we allocate per cpu storage, let's also use NUMA hints.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.
diff mbox

Patch

diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c
index 5215e1eba01030dc9345b847eee5ac5ef3bed1b9..b274f1d95e037c93e8e0e6531cfc51709f71297c 100644
--- a/net/ipv6/seg6_hmac.c
+++ b/net/ipv6/seg6_hmac.c
@@ -389,7 +389,8 @@  static int seg6_hmac_init_algo(void)
 			return -ENOMEM;
 
 		for_each_possible_cpu(cpu) {
-			shash = kzalloc(shsize, GFP_KERNEL);
+			shash = kzalloc_node(shsize, GFP_KERNEL,
+					     cpu_to_node(cpu));
 			if (!shash)
 				return -ENOMEM;
 			*per_cpu_ptr(algo->shashs, cpu) = shash;