[lkml]   [2005]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 8/8] Inline 3 functions
On Tue, Nov 08, 2005 at 11:08:30AM -0800, Matthew Dobson wrote:
> Pekka J Enberg wrote:
> > On Mon, 7 Nov 2005, Matthew Dobson wrote:
> >
> >>I found three functions in slab.c that have only 1 caller (kmem_getpages,
> >>alloc_slabmgmt, and set_slab_attr), so let's inline them.
> >
> >
> > Why? They aren't on the hot path and I don't see how this is an
> > improvement...
> >
> > Pekka
> Well, no, they aren't on the hot path. I just figured since they are only
> ever called from one other function, why not inline them? If the sentiment
> is that it's a BAD idea, I'll drop it.

And if there will one day be a second caller, noone will remember to
remove the inline...

At least with unit-at-a-time [1], gcc should be smart enough to inline
all static functions when it does make sense.

> -Matt


[1] currently disabled in the kernel on i386, but this will change at
least for the latest gcc in the mid-term future


"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
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-11-10 12:04    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean