From: "David S. Miller" <davem@davemloft.net>
To: Patrick McHardy <kaber@trash.net>
Cc: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org,
bdschuym@pandora.be, bridge@osdl.org, snort2004@mail.ru,
rusty@rustcorp.com.au, dwmw2@infradead.org, ak@suse.de,
shemminger@osdl.org, gandalf@wlug.westbo.se
Subject: [Bridge] Re: [PATCH/RFC] Reduce call chain length in netfilter
Date: Wed, 26 Jan 2005 23:18:01 -0800 [thread overview]
Message-ID: <20050126231801.7bf90338.davem@davemloft.net> (raw)
In-Reply-To: <41F82C6D.7020006@trash.net>
On Thu, 27 Jan 2005 00:49:01 +0100
Patrick McHardy <kaber@trash.net> wrote:
> Bart De Schuymer wrote:
>
> >Does anyone have objections to this patch, which reduces the netfilter
> >call chain length?
> >
> Looks fine to me.
>
> Signed-off-by: Patrick McHardy <kaber@trash.net>
Ok, I applied this.
While reviewing I thought it may be an issue that the new macros
potentially change skb. It really isn't an issue because NF_HOOK()
calls pass ownership of the SKB over from the caller.
Although technically, someone could go:
skb_get(skb);
err = NF_HOOK(... skb ...);
... do stuff with skb ...
kfree_skb(skb);
but that would cause other problems and I audited the entire tree
and nobody attempts anything like this currently. 'skb' always
dies at the NF_HOOK() call site.
I guess if we wanted to preserve NF_HOOK*() semantics even in such
a case we could use a local "__skb" var in the macro's basic block.
Another huge downside to this change I was worried about
was from a code generation point of view. Since we now take the
address of "skb", gcc cannot generate tail-calls for the common
case of:
return NF_HOOK(...);
when netfilter is enabled. Ho hum...
Wait...
This is actually an important point! Since gcc is generating a tail-
call for NF_HOOK() today, there is no stack savings for NF_HOOK()
created by this patch. The only real gain is the NF_STOP stuff
for bridge netfilter.
I'm backing this out of my tree, let's think about this some more.
Perhaps it's only worth adding the NF_STOP thing and just making
nf_hook_slow() do the okfn(skb); call in that case?
WARNING: multiple messages have this Message-ID (diff)
From: "David S. Miller" <davem@davemloft.net>
To: Patrick McHardy <kaber@trash.net>
Cc: bdschuym@pandora.be, netdev@oss.sgi.com,
netfilter-devel@lists.netfilter.org, snort2004@mail.ru,
rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org,
gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org
Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter
Date: Wed, 26 Jan 2005 23:18:01 -0800 [thread overview]
Message-ID: <20050126231801.7bf90338.davem@davemloft.net> (raw)
In-Reply-To: <41F82C6D.7020006@trash.net>
On Thu, 27 Jan 2005 00:49:01 +0100
Patrick McHardy <kaber@trash.net> wrote:
> Bart De Schuymer wrote:
>
> >Does anyone have objections to this patch, which reduces the netfilter
> >call chain length?
> >
> Looks fine to me.
>
> Signed-off-by: Patrick McHardy <kaber@trash.net>
Ok, I applied this.
While reviewing I thought it may be an issue that the new macros
potentially change skb. It really isn't an issue because NF_HOOK()
calls pass ownership of the SKB over from the caller.
Although technically, someone could go:
skb_get(skb);
err = NF_HOOK(... skb ...);
... do stuff with skb ...
kfree_skb(skb);
but that would cause other problems and I audited the entire tree
and nobody attempts anything like this currently. 'skb' always
dies at the NF_HOOK() call site.
I guess if we wanted to preserve NF_HOOK*() semantics even in such
a case we could use a local "__skb" var in the macro's basic block.
Another huge downside to this change I was worried about
was from a code generation point of view. Since we now take the
address of "skb", gcc cannot generate tail-calls for the common
case of:
return NF_HOOK(...);
when netfilter is enabled. Ho hum...
Wait...
This is actually an important point! Since gcc is generating a tail-
call for NF_HOOK() today, there is no stack savings for NF_HOOK()
created by this patch. The only real gain is the NF_STOP stuff
for bridge netfilter.
I'm backing this out of my tree, let's think about this some more.
Perhaps it's only worth adding the NF_STOP thing and just making
nf_hook_slow() do the okfn(skb); call in that case?
next prev parent reply other threads:[~2005-01-27 7:18 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel>
2004-12-18 7:50 ` do_IRQ: stack overflow: 872 Andi Kleen
2004-12-18 11:12 ` Bart De Schuymer
2004-12-18 11:14 ` Andi Kleen
2004-12-18 11:51 ` Bart De Schuymer
2004-12-18 13:53 ` Andi Kleen
2004-12-18 16:07 ` Re[2]: " Crazy AMD K7
2004-12-18 16:46 ` Bart De Schuymer
2005-01-07 17:05 ` David Woodhouse
2005-01-07 18:00 ` [Bridge] " Stephen Hemminger
2005-01-07 18:00 ` Stephen Hemminger
2005-01-07 18:06 ` [Bridge] " David Woodhouse
2005-01-07 18:06 ` David Woodhouse
2005-01-07 21:27 ` [Bridge] " Bart De Schuymer
2005-01-07 21:27 ` Bart De Schuymer
2005-01-18 21:57 ` [Bridge] " David S. Miller
2005-01-18 21:57 ` David S. Miller
2005-01-22 22:30 ` [Bridge] [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) Bart De Schuymer
2005-01-22 22:30 ` Bart De Schuymer
2005-01-22 23:22 ` [Bridge] " Martin Josefsson
2005-01-22 23:22 ` Martin Josefsson
2005-01-23 12:40 ` [Bridge] " Bart De Schuymer
2005-01-23 12:40 ` Bart De Schuymer
2005-01-23 16:08 ` [Bridge] " Martin Josefsson
2005-01-23 16:08 ` Martin Josefsson
2005-01-26 6:05 ` [Bridge] " David S. Miller
2005-01-26 6:05 ` David S. Miller
2005-01-26 9:08 ` [Bridge] " Bart De Schuymer
2005-01-26 9:08 ` Bart De Schuymer
2005-01-26 23:49 ` [Bridge] Re: [PATCH/RFC] Reduce call chain length in netfilter Patrick McHardy
2005-01-26 23:49 ` Patrick McHardy
2005-01-27 7:18 ` David S. Miller [this message]
2005-01-27 7:18 ` David S. Miller
2005-01-27 17:50 ` [Bridge] " Patrick McHardy
2005-01-27 17:50 ` Patrick McHardy
2005-01-27 19:47 ` [Bridge] " David S. Miller
2005-01-27 19:47 ` David S. Miller
2005-01-27 21:16 ` [Bridge] " Bart De Schuymer
2005-01-27 21:16 ` Bart De Schuymer
2005-01-27 22:48 ` [Bridge] " Patrick McHardy
2005-01-27 22:48 ` Patrick McHardy
2005-01-27 23:24 ` [Bridge] " David S. Miller
2005-01-27 23:24 ` David S. Miller
2005-01-28 0:08 ` [Bridge] " Patrick McHardy
2005-01-28 0:08 ` Patrick McHardy
2005-01-28 0:29 ` [Bridge] " Rusty Russell
2005-01-28 0:29 ` Rusty Russell
2005-01-28 1:10 ` [Bridge] " David S. Miller
2005-01-28 1:10 ` David S. Miller
2005-01-28 1:32 ` [Bridge] " Rusty Russell
2005-01-28 1:32 ` Rusty Russell
2005-01-28 1:35 ` [Bridge] " Patrick McHardy
2005-01-28 1:35 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050126231801.7bf90338.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ak@suse.de \
--cc=bdschuym@pandora.be \
--cc=bridge@osdl.org \
--cc=dwmw2@infradead.org \
--cc=gandalf@wlug.westbo.se \
--cc=kaber@trash.net \
--cc=netdev@oss.sgi.com \
--cc=netfilter-devel@lists.netfilter.org \
--cc=rusty@rustcorp.com.au \
--cc=shemminger@osdl.org \
--cc=snort2004@mail.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.