[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20080410.014938.247220159.davem@davemloft.net>
Date: Thu, 10 Apr 2008 01:49:38 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: shemminger@...tta.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 2/6] socket: sk_filter deinline
From: Stephen Hemminger <shemminger@...tta.com>
Date: Mon, 31 Mar 2008 17:47:10 -0700
> The sk_filter function is too big to be inlined. This saves 2296 bytes
> of text on allyesconfig.
>
> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
Because of the bloat I'll apply this to net-2.6.26
But I think we can do better in many of the callsites.
Most of them are in the packet receive path, have BH's disabled, and a
lot of the variables already laid out in registers.
I would like to see a new inline created that caters to these cases,
which does something like:
if (rcu_dereference(sk->sk_filter))
return sk_filter(sk, skb);
else
return 0;
The security check muddles things here, but that should be inlined in
such situations too I think.
It's all of that "pkt_len = this; pskb_trim(that);" that makes for
most of the bloat. And that can stay in the un-inlined sk_filter() we
have now.
Having a socket filter enabled on a TCP socket is so rare, but
now everyone pays for the function call unconditionally.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists