rps: NUMA flow limit allocations
authorEric Dumazet <edumazet@google.com>
Wed, 18 Dec 2013 14:46:23 +0000 (06:46 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Dec 2013 00:00:07 +0000 (19:00 -0500)
Given we allocate memory for each cpu, we can do this
using NUMA affinities, instead of using NUMA policies
of the process changing flow_limit_cpu_bitmap value.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sysctl_net_core.c

index cca444190907c9da8ea1ac86f998d76c0574ace9..cf9cd13509a7d531f9e4a455d2909f5dfb731923 100644 (file)
@@ -122,7 +122,8 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
                                synchronize_rcu();
                                kfree(cur);
                        } else if (!cur && cpumask_test_cpu(i, mask)) {
-                               cur = kzalloc(len, GFP_KERNEL);
+                               cur = kzalloc_node(len, GFP_KERNEL,
+                                                  cpu_to_node(i));
                                if (!cur) {
                                        /* not unwinding previous changes */
                                        ret = -ENOMEM;