Re: [RFC PATCH 4/4] kmemtrace: SLOB hooks.

From: Eduard - Gabriel Munteanu
Date: Tue Jul 22 2008 - 17:09:45 EST


On Tue, Jul 22, 2008 at 03:53:55PM -0500, Matt Mackall wrote:
>
> On Tue, 2008-07-22 at 21:36 +0300, Eduard - Gabriel Munteanu wrote:
> > -static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
> > +static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
> > + gfp_t flags)
> > {
> > return kmem_cache_alloc_node(cachep, flags, -1);
> > }
>
> Why is this needed? builtin_return?

If we don't use __always_inline, we can't be sure whether it's inlined
or not. And we don't know if we need _THIS_IP_ or _RET_IP_ (equivalent
to __builtin_return_address(0)). Simple, plain 'inline' does not
guarantee GCC will inline that function, nor does it warn us if it is
not inlined.

--
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/