Messages in this thread | | | Subject | Re: [PATCH]micro optimization of kcalloc | From | Valdis.Kletnieks@vt ... | Date | Wed, 22 Mar 2006 00:40:45 -0500 |
| |
On Mon, 20 Mar 2006 10:44:00 PST, David Lang said: > On Mon, 20 Mar 2006, Pekka Enberg wrote:
> > On Mon, Mar 20, 2006 at 03:45:23PM +0100, Oliver Neukum wrote: > >>> static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
> > On 3/20/06, Benjamin LaHaise <bcrl@kvack.org> wrote: > >> This function shouldn't be inlined. We have no need to optimize the > >> unlikely case like this. > > > > IIRC, I made it static inline in the first place because that actually > > reduced kernel text size. (And I think it was Adrian who made me do it > > :-). > > I wonder if this is still needed with the new inline changes that were > made to allow GCC to make the decision (for recent GCC's)
One non-obvious reason to inline it (at least in -mm kernels) is because the slab leak detector stuff wants to find where it was called from - and if you don't inline kcalloc(), you end up with the kzalloc() call it makes showing kcalloc() as the caller. If you inline it, you end up showing the caller of kcalloc() instead, which is far more useful..... [unhandled content-type:application/pgp-signature] | |