lkml.org 
[lkml]   [2009]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] SLUB: Fix __GFP_ZERO unlikely() annotation
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.


\
 
 \ /
  Last update: 2009-11-25 19:33    [W:0.057 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site