lkml.org 
[lkml]   [2018]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] driver core: Add branch prediction hints in really_probe()
On Tue, Nov 6, 2018 at 3:43 PM Muchun Song <smuchun@gmail.com> wrote:
>
> Hi Rafael,
>
> If we want the driver core to test driver remove functions, we can
> enable CONFIG_DEBUG_TEST_DRIVER_REMOVE. This option is
> just for testing it. So, in most cases, the option is disabled and the if
> condition is false. So I think we can add an unlikely() to it.

Yes, it can be added there, but does it really need to be added?

If the conditions are false all the time, the branch predictor in the
processor should be able to deal with it just fine.

And if they are false already at build time, the compiler should just
optimize them away.

\
 
 \ /
  Last update: 2018-11-06 16:00    [W:0.039 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site