[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1429017572.7346.20.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 14 Apr 2015 06:19:32 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Denys Vlasenko <dvlasenk@...hat.com>
Cc: "David S. Miller" <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Jan Engelhardt <jengelh@...ozas.de>,
Jiri Pirko <jpirko@...hat.com>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] netns: deinline net_generic()
On Tue, 2015-04-14 at 14:25 +0200, Denys Vlasenko wrote:
> On x86 allyesconfig build:
> The function compiles to 130 bytes of machine code.
> It has 493 callsites.
> Total reduction of vmlinux size: 27906 bytes.
>
> text data bss dec hex filename
> 82447071 22255384 20627456 125329911 77861f7 vmlinux4
> 82419165 22255384 20627456 125302005 777f4f5 vmlinux5
This sounds a big hammer to me.
These savings probably comes from the BUG_ON() that could simply be
removed.
The second one for sure has no purpose. First one looks defensive.
For a typical (non allyesconfig) kernel, net_generic() would translate
to :
return net->gen[id - 1]
Tunnels need this in fast path, so I presume we could introduce
net_generic_rcu() to keep this stuff inlined where it matters.
static inline void *net_generic_rcu(const struct net *net, int id)
{
struct net_generic *ng = rcu_dereference(net->gen);
return ng->ptr[id - 1];
}
--
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