All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
	Christoph Lameter <cl@linux-foundation.org>
Subject: Re: [PATCH] SLUB: Fix __GFP_ZERO unlikely() annotation
Date: Wed, 25 Nov 2009 20:30:36 +0200	[thread overview]
Message-ID: <4B0D77CC.3020807@cs.helsinki.fi> (raw)
In-Reply-To: <1259173636.29779.41.camel@Joe-Laptop.home>

Joe Perches wrote:
> On Wed, 2009-11-25 at 20:21 +0200, Pekka Enberg wrote:
>> The unlikely() annotation in slab_alloc() covers too much of the expression.
>> It's actually very likely that the object is not NULL so use unlikely() only
>> for the __GFP_ZERO expression like SLAB does.
> []
>> +++ b/mm/slub.c
>> @@ -1735,7 +1735,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
>> -	if (unlikely((gfpflags & __GFP_ZERO) && object))
>> +	if (unlikely(gfpflags & __GFP_ZERO) && object)
>>  		memset(object, 0, objsize);
> 
> so why not use
> 
> 	if (unlikely(gfpflags & __GFP_ZERO) && likely(object))

Because that has no effect on the generated code.

  reply	other threads:[~2009-11-25 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 18:21 [PATCH] SLUB: Fix __GFP_ZERO unlikely() annotation Pekka Enberg
2009-11-25 18:27 ` Joe Perches
2009-11-25 18:30   ` Pekka Enberg [this message]
2009-11-25 20:15     ` Christoph Lameter
2009-11-25 20:19       ` Pekka Enberg
2009-11-26 20:27       ` Pekka Enberg
2009-11-27 19:26         ` Christoph Lameter

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=4B0D77CC.3020807@cs.helsinki.fi \
    --to=penberg@cs.helsinki.fi \
    --cc=cl@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.