public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Pekka J Enberg <penberg@cs.Helsinki.FI>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Denis Vlasenko <vda@ilport.com.ua>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [-mm patch] make kcalloc() a static inline
Date: Mon, 15 Aug 2005 18:30:46 +0200	[thread overview]
Message-ID: <20050815163046.GC3614@stusta.de> (raw)
In-Reply-To: <Pine.LNX.4.58.0508151601540.3068@sbz-30.cs.Helsinki.FI>

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

cu
Adrian

-- 

       "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


      parent reply	other threads:[~2005-08-15 16:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 22:38 [-mm patch] make kcalloc() a static inline Adrian Bunk
2005-08-09  5:09 ` Pekka J Enberg
2005-08-15  8:06 ` [-mm patch] " Denis Vlasenko
2005-08-15  8:14   ` Arjan van de Ven
2005-08-15  8:20     ` Denis Vlasenko
2005-08-15  8:28       ` Pekka J Enberg
2005-08-15  9:33         ` Denis Vlasenko
2005-08-15  9:41           ` Arjan van de Ven
2005-08-15 12:17             ` Denis Vlasenko
2005-08-15 12:25               ` Arjan van de Ven
2005-08-15 13:06                 ` Pekka J Enberg
2005-08-15 13:51                   ` Alan Cox
2005-08-15 16:30                   ` Adrian Bunk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050815163046.GC3614@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.Helsinki.FI \
    --cc=vda@ilport.com.ua \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox