[lkml]   [2005]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [-mm patch] make kcalloc() a static inline
On Mon, Aug 15, 2005 at 04:06:22PM +0300, Pekka J Enberg wrote:
> On Mon, 2005-08-15 at 15:17 +0300, Denis Vlasenko wrote:
> > > Seems like that optimization is not helping.
> > > Do you have better example?
> On Mon, 15 Aug 2005, Arjan van de Ven wrote:
> > you need gcc 4.1 (eg CVS) for the value range propagation stuff.
> For Denis' example, it does not seem to help. I must admit I did not know
> GCC 3.x does not have this optimization. I am also bit confused as Adrian
> and I saw small reduction in kernel text with kcalloc() inlined. If GCC
> is, in fact, spreading the extra operations everywhere, shouldn't kernel
> text be bigger?

Denis' example is a case where gcc might not produce the best code
possible, but anyway his example isn't the typical in-kernel example.

In most in-kernel cases the first two arguments of kcalloc() are
constant at compile-time - and in these cases all gcc versions supported
by the kernel are able to optimize away the checks.

> Pekka



"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-08-15 18:33    [W:0.051 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site