2007-12-16 20:48:19

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH] net/ipv4/netfilter/ip_tables.c: remove some inlines

Hi Patrick, Harald,

I was working on unrelated problem and noticed that ip_tables.c
seem to abuse inline. I prepared a patch which removes inlines
except those which are used by packet matching code
(and thus are really performance-critical).
I added comments explaining that remaining inlines are
performance critical.

Result as reported by size:

text data bss dec hex filename
- 6451 380 88 6919 1b07 ip_tables.o
+ 6339 348 72 6759 1a67 ip_tables.o

Please take this patch into netfilter queue.

Signed-off-by: Denys Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (615.00 B)
linux-2.6.ipt.diff (6.40 kB)
Download all attachments

2007-12-17 14:48:09

by Patrick McHardy

[permalink] [raw]
Subject: Re: [PATCH] net/ipv4/netfilter/ip_tables.c: remove some inlines

Please CC netfilter-devel on netfilter patches.

Denys Vlasenko wrote:
> Hi Patrick, Harald,
>
> I was working on unrelated problem and noticed that ip_tables.c
> seem to abuse inline. I prepared a patch which removes inlines
> except those which are used by packet matching code
> (and thus are really performance-critical).
> I added comments explaining that remaining inlines are
> performance critical.
>
> Result as reported by size:
>
> text data bss dec hex filename
> - 6451 380 88 6919 1b07 ip_tables.o
> + 6339 348 72 6759 1a67 ip_tables.o
>
> Please take this patch into netfilter queue.


This clashes with my pending patches, which I'll push upstream
today. I also spent some time resyncing ip_tables and ip6_tables
so a diff of both (with some sed'ing) shows only the actual
differences, so please update ip6_tables as well.

2007-12-27 04:01:54

by Denys Vlasenko

[permalink] [raw]
Subject: Re: [PATCH] net/ipv4/netfilter/ip_tables.c: remove some inlines

On Monday 17 December 2007 14:47, Patrick McHardy wrote:
> Please CC netfilter-devel on netfilter patches.
>
> Denys Vlasenko wrote:
> > Hi Patrick, Harald,
> >
> > I was working on unrelated problem and noticed that ip_tables.c
> > seem to abuse inline. I prepared a patch which removes inlines
> > except those which are used by packet matching code
> > (and thus are really performance-critical).
> > I added comments explaining that remaining inlines are
> > performance critical.
> >
> > Result as reported by size:
> >
> > text data bss dec hex filename
> > - 6451 380 88 6919 1b07 ip_tables.o
> > + 6339 348 72 6759 1a67 ip_tables.o
> >
> > Please take this patch into netfilter queue.
>
> This clashes with my pending patches, which I'll push upstream
> today. I also spent some time resyncing ip_tables and ip6_tables
> so a diff of both (with some sed'ing) shows only the actual
> differences, so please update ip6_tables as well.

I would be happy to rediff the patch.

Which tree should I sync against in order to not collide
with your changes?
--
vda

2007-12-28 15:31:03

by Patrick McHardy

[permalink] [raw]
Subject: Re: [PATCH] net/ipv4/netfilter/ip_tables.c: remove some inlines

Denys Vlasenko wrote:
> On Monday 17 December 2007 14:47, Patrick McHardy wrote:
>
>> This clashes with my pending patches, which I'll push upstream
>> today. I also spent some time resyncing ip_tables and ip6_tables
>> so a diff of both (with some sed'ing) shows only the actual
>> differences, so please update ip6_tables as well.
>>
>
> I would be happy to rediff the patch.
>
> Which tree should I sync against in order to not collide
> with your changes?
>

The net-2.6.25.git tree contains all my changes.

2007-12-31 16:44:06

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH] ip[6]_tables.c: remove some inlines

On Friday 28 December 2007 15:30, Patrick McHardy wrote:
> >> This clashes with my pending patches, which I'll push upstream
> >> today. I also spent some time resyncing ip_tables and ip6_tables
> >> so a diff of both (with some sed'ing) shows only the actual
> >> differences, so please update ip6_tables as well.
> >
> > I would be happy to rediff the patch.
> >
> > Which tree should I sync against in order to not collide
> > with your changes?
>
> The net-2.6.25.git tree contains all my changes.

ip[6]_tables.c seem to abuse inline.

This patch removes inlines except those which are used
by packet matching code and thus are performance-critical.

Please take this patch into netfilter queue.

Signed-off-by: Denys Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (767.00 B)
net-2.6.25_iptable_deinlined.patch (11.38 kB)
Download all attachments

2007-12-31 17:01:14

by Patrick McHardy

[permalink] [raw]
Subject: Re: [PATCH] ip[6]_tables.c: remove some inlines

Denys Vlasenko wrote:
> ip[6]_tables.c seem to abuse inline.
>
> This patch removes inlines except those which are used
> by packet matching code and thus are performance-critical.
>

Some people also consider the ruleset replacement path performance
critical, but overall I agree with your patch. I'm travelling currently
though so it will take a few days until I'll apply it.

Do you have some numbers that show the actual difference these
changes make?

2007-12-31 17:55:24

by Denys Vlasenko

[permalink] [raw]
Subject: Re: [PATCH] ip[6]_tables.c: remove some inlines

On Monday 31 December 2007 17:00, Patrick McHardy wrote:
> Denys Vlasenko wrote:
> > ip[6]_tables.c seem to abuse inline.
> >
> > This patch removes inlines except those which are used
> > by packet matching code and thus are performance-critical.
> >
>
> Some people also consider the ruleset replacement path performance
> critical, but overall I agree with your patch. I'm travelling currently
> though so it will take a few days until I'll apply it.
>
> Do you have some numbers that show the actual difference these
> changes make?

Before:

$ size */*/*/ip*tables*.o
text data bss dec hex filename
6402 500 16 6918 1b06 net/ipv4/netfilter/ip_tables.o
7130 500 16 7646 1dde net/ipv6/netfilter/ip6_tables.o

After:

$ size */*/*/ip*tables*.o
text data bss dec hex filename
6307 500 16 6823 1aa7 net/ipv4/netfilter/ip_tables.o
7010 500 16 7526 1d66 net/ipv6/netfilter/ip6_tables.o

--
vda

2008-01-08 16:40:34

by Patrick McHardy

[permalink] [raw]
Subject: Re: [PATCH] ip[6]_tables.c: remove some inlines

Denys Vlasenko wrote:
> On Monday 31 December 2007 17:00, Patrick McHardy wrote:
>> Denys Vlasenko wrote:
>>> ip[6]_tables.c seem to abuse inline.
>>>
>>> This patch removes inlines except those which are used
>>> by packet matching code and thus are performance-critical.
>>>
>> Some people also consider the ruleset replacement path performance
>> critical, but overall I agree with your patch. I'm travelling currently
>> though so it will take a few days until I'll apply it.
>>
>> Do you have some numbers that show the actual difference these
>> changes make?
>
> Before:
>
> $ size */*/*/ip*tables*.o
> text data bss dec hex filename
> 6402 500 16 6918 1b06 net/ipv4/netfilter/ip_tables.o
> 7130 500 16 7646 1dde net/ipv6/netfilter/ip6_tables.o
>
> After:
>
> $ size */*/*/ip*tables*.o
> text data bss dec hex filename
> 6307 500 16 6823 1aa7 net/ipv4/netfilter/ip_tables.o
> 7010 500 16 7526 1d66 net/ipv6/netfilter/ip6_tables.o


Applied, thanks.