lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 6 Nov 2018 23:12:51 +0800
From:   Muchun Song <smuchun@...il.com>
To:     rafael@...nel.org
Cc:     gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] driver core: Add branch prediction hints in really_probe()

Hi Rafael,

>
> On Tue, Nov 6, 2018 at 3:43 PM Muchun Song <smuchun@...il.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.

Thank you for your explanation. I really didn't take into account the
situation you said. Yeah, the compiler can optimize them away or
the processor can deal with it.

So,  we don't need to add unlikely() to it. The patch does't make sense.
Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ