[PATCH] [RFT] ip_tables NUMA optimization

STALE7559d

6 messages, 3 authors, 2005-11-22 · open the first message on its own page

[PATCH] [RFT] ip_tables NUMA optimization

From: Harald Welte <hidden>
Date: 2005-11-17 14:43:28

I've hand-merged Eric Dumazet's original ip_tables numa optimization
patch to current git head.  Also, I've ported it to ip6_tables and
arp_tables.

Since this is 2.6.16 stuff, I don't want to have it applied at this
time, but merely request testers (esp. for the non-ipv4 part).

Thanks,

-- 
- Harald Welte [off-list ref]                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

Re: [PATCH] [RFT] ip_tables NUMA optimization

From: Eric Dumazet <hidden>
Date: 2005-11-17 15:21:45

Harald Welte a écrit :
I've hand-merged Eric Dumazet's original ip_tables numa optimization
patch to current git head.  Also, I've ported it to ip6_tables and
arp_tables.

Since this is 2.6.16 stuff, I don't want to have it applied at this
time, but merely request testers (esp. for the non-ipv4 part).

Thanks,
Hi Harald

Thank you for doing this, since I'm currently too busy with my day job to 
update the patch myself.

However I did read your patch and caught one vfree() call wrongly replaced by 
a kfree() call in arp_tables.c

quoted hunk
@@ -911,6 +930,47 @@ static int get_entries(const struct arpt
 	return ret;
 }
 
+static void free_table_info(struct arpt_table_info *info)
+{
+	int cpu;
+	for_each_cpu(cpu) {
+		if (info->size <= PAGE_SIZE)
+			kfree(info->entries[cpu]);
+		else
+			kfree(info->entries[cpu]);   !!!!
+	}
+	kfree(info);

It should probably use vfree() like :

 > +	for_each_cpu(cpu) {
 > +		if (info->size <= PAGE_SIZE)
 > +			kfree(info->entries[cpu]);
 > +		else
 > +			vfree(info->entries[cpu]);
 > +	}


See you

Eric Dumazet

Re: [PATCH] [RFT] ip_tables NUMA optimization

From: "David S. Miller" <davem@davemloft.net>
Date: 2005-11-19 00:00:43

From: Eric Dumazet <redacted>
Date: Thu, 17 Nov 2005 16:21:45 +0100
It should probably use vfree() like :

 > +	for_each_cpu(cpu) {
 > +		if (info->size <= PAGE_SIZE)
 > +			kfree(info->entries[cpu]);
 > +		else
 > +			vfree(info->entries[cpu]);
 > +	}
I've put the patch into the net-2.6.16 tree with the obvious
fix Eric points out.

Thanks.

Re: [PATCH] [RFT] ip_tables NUMA optimization

From: Harald Welte <hidden>
Date: 2005-11-19 08:45:47

On Fri, Nov 18, 2005 at 04:00:43PM -0800, David S. Miller wrote:
 
quoted
It should probably use vfree() like :

 > +	for_each_cpu(cpu) {
 > +		if (info->size <= PAGE_SIZE)
 > +			kfree(info->entries[cpu]);
 > +		else
 > +			vfree(info->entries[cpu]);
 > +	}
I've put the patch into the net-2.6.16 tree with the obvious
fix Eric points out.
thanks!

-- 
- Harald Welte [off-list ref]                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[PATCH] NETFILTER arp_tables: Fix NUMA optimization

From: Harald Welte <hidden>
Date: 2005-11-19 10:31:31

Hi Dave!

On Fri, Nov 18, 2005 at 04:00:43PM -0800, David S. Miller wrote:
I've put the patch into the net-2.6.16 tree with the obvious
fix Eric points out.
There's another one that I detected while merging those changes with
x_tables (painful).  Please merge:


[NETFILTER] arp_tables: Fix bug introduced with NUMA aware allocation

This fix shows how bad I am with copy & paste.

Signed-off-by: Harald Welte <redacted>

---
commit 4fa8b41b4adc117876114c149885fc8921fcabde
tree 950bd802e3daf69ad55fc203765c31ebead4fe5d
parent a7b935151849464c804437ee411dc64641c6f298
author Harald Welte [off-list ref] Sat, 19 Nov 2005 11:29:40 +0100
committer Harald Welte [off-list ref] Sat, 19 Nov 2005 11:29:40 +0100

 net/ipv4/netfilter/arp_tables.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -757,7 +757,7 @@ static int translate_table(const char *n
 	/* And one copy for every other CPU */
 	for_each_cpu(i) {
 		if (newinfo->entries[i] && newinfo->entries[i] != entry0)
-			memcpy(newinfo->entries[smp_processor_id()], entry0, newinfo->size);
+			memcpy(newinfo->entries[i], entry0, newinfo->size);
 	}
 
 	return ret;
-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

Re: [PATCH] NETFILTER arp_tables: Fix NUMA optimization

From: "David S. Miller" <davem@davemloft.net>
Date: 2005-11-22 22:28:36

From: Harald Welte <redacted>
Date: Sat, 19 Nov 2005 11:31:31 +0100
There's another one that I detected while merging those changes with
x_tables (painful).  Please merge:

[NETFILTER] arp_tables: Fix bug introduced with NUMA aware allocation

This fix shows how bad I am with copy & paste.

Signed-off-by: Harald Welte <redacted>
Added to net-2.6.16, thanks a lot.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help