lkml.org 
[lkml]   [2018]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/4] staging: lustre: obdclass: change object lookup to no wait mode
Date
On May 16, 2018, at 02:00, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Tue, May 15, 2018 at 04:02:55PM +0100, James Simmons wrote:
>>
>>>> /*
>>>> * Allocate new object. This may result in rather complicated
>>>> * operations, including fld queries, inode loading, etc.
>>>> */
>>>> o = lu_object_alloc(env, dev, f, conf);
>>>> - if (IS_ERR(o))
>>>> + if (unlikely(IS_ERR(o)))
>>>> return o;
>>>>
>>>
>>> This is an unrelated and totally pointless. likely/unlikely annotations
>>> hurt readability, and they should only be added if it's something which
>>> is going to show up in benchmarking. lu_object_alloc() is already too
>>> slow for the unlikely() to make a difference and anyway IS_ERR() has an
>>> unlikely built in so it's duplicative...
>>
>> Sounds like a good checkpatch case to test for :-)
>
> The likely/unlikely annotations have their place in fast paths so a
> checkpatch warning would get annoying...

I think James was suggesting a check for unlikely(IS_ERR()), or possibly
a check for unlikely() on something that is already unlikely() after CPP
expansion.

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation







\
 
 \ /
  Last update: 2018-05-16 11:13    [W:0.030 / U:33.904 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site