Re: [2.6 patch] kernel/cgroup.c: make 2 functions static

From: Adrian Bunk
Date: Wed Oct 24 2007 - 12:56:42 EST


On Wed, Oct 24, 2007 at 09:32:26AM -0700, Paul Menage wrote:
> On 10/24/07, Adrian Bunk <bunk@xxxxxxxxxx> wrote:
> > cgroup_is_releasable() and notify_on_release() should be static,
> > not global inline.
> >
>
> They seem like they could be usefully static inline - or will the
> compiler inline them anyway since they're simple enough?

gcc [1] will currently always inline a static cgroup_is_releasable() as
long as it only has one caller.

Besides this, the compiler has the opportunity to inline all static
functions when it thinks this makes sense, and it can base it's decision
on things like whether we gave it -Os/-O2 and which CPU it's compiling
for.

Long term manually forced "inline" has negative effects since functions
tend to become larger and more often called without the "inline"
removed, so don't use it unless there is a visible performance
difference.

> Paul

cu
Adrian

[1] I'm talking about gcc 4

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/