diff mbox series

netfilter: ebtables: allocate chainstack on CPU local nodes

Message ID 20211010182439.11036-1-dave@stgolabs.net
State Accepted
Delegated to: Pablo Neira
Headers show
Series netfilter: ebtables: allocate chainstack on CPU local nodes | expand

Commit Message

Davidlohr Bueso Oct. 10, 2021, 6:24 p.m. UTC
Keep the per-CPU memory allocated for chainstacks local.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 net/bridge/netfilter/ebtables.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Pablo Neira Ayuso Oct. 17, 2021, 10:23 p.m. UTC | #1
On Sun, Oct 10, 2021 at 11:24:39AM -0700, Davidlohr Bueso wrote:
> Keep the per-CPU memory allocated for chainstacks local.

Applied to nf.git, thanks
diff mbox series

Patch

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 83d1798dfbb4..ba045f35114d 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -926,7 +926,9 @@  static int translate_table(struct net *net, const char *name,
 			return -ENOMEM;
 		for_each_possible_cpu(i) {
 			newinfo->chainstack[i] =
-			  vmalloc(array_size(udc_cnt, sizeof(*(newinfo->chainstack[0]))));
+			  vmalloc_node(array_size(udc_cnt,
+					  sizeof(*(newinfo->chainstack[0]))),
+				       cpu_to_node(i));
 			if (!newinfo->chainstack[i]) {
 				while (i)
 					vfree(newinfo->chainstack[--i]);