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] [day] [month] [year] [list]
Message-ID: <Yql57cL4aFbnykfL@kroah.com>
Date:   Wed, 15 Jun 2022 08:19:25 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     chi wu <wuchi.zero@...il.com>
Cc:     alexios.zavras@...el.com, allison@...utok.net, armijn@...ldur.nl,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lib/klist: Remove mb() before wake_up_process

On Wed, Jun 15, 2022 at 11:30:51AM +0800, chi wu wrote:
> Greg KH <gregkh@...uxfoundation.org> 于2022年6月14日周二 22:58写道:
> >
> > On Tue, Jun 14, 2022 at 10:44:43PM +0800, wuchi wrote:
> > > Function wake_up_process always executes a general memory barrier,
> > > so remove the mb() before it.
> >
> > Really?  On all systems?  I do not see that, where does it happen?
> >
> As I understand it, it is on all systems.  Please help correct the
> mistake, thanks.
> 
> 1. Follow  Documentation/memory-barriers.txt  line 2128 ~ 2278,
> especially line 2187 ~ 2202 snippet:
>         A general memory barrier is executed by wake_up() if it wakes
> something up.
>         If it doesn't wake anything up then a memory barrier may or may not be
>         executed; you must not rely on it.

So as the documentation states, it might not be there, so if you have to
have a memory barrier, you must not rely on this function to provide it.

So unless you have testing proof otherwise, the code should be correct
as-is.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ