On Mon 05-11-12 16:28:37, Andrew Morton wrote: > On Thu, 1 Nov 2012 16:07:35 +0400 > Glauber Costa <glommer@xxxxxxxxxxxxx> wrote: > > > +static __always_inline struct kmem_cache * > > +memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) > > I still don't understand why this code uses __always_inline so much. AFAIU, __always_inline (resp. __attribute__((always_inline))) is the same thing as inline if optimizations are enabled (http://ohse.de/uwe/articles/gcc-attributes.html#func-always_inline). Which is the case for the kernel. I was always wondering why we have this __always_inline thingy. It has been introduced back in 2004 by Andi but the commit log doesn't say much: " [PATCH] gcc-3.5 fixes Trivial gcc-3.5 build fixes. " Andi what was the original motivation for this attribute? > I don't recall seeing the compiler producing out-of-line versions of > "static inline" functions and if it decides then __always_inline will not help, right? -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>