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]
Message-ID: <20180619143044.GB2512@hirez.programming.kicks-ass.net>
Date:   Tue, 19 Jun 2018 16:30:44 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Quentin Perret <quentin.perret@....com>
Cc:     rjw@...ysocki.net, gregkh@...uxfoundation.org,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        mingo@...hat.com, dietmar.eggemann@....com,
        morten.rasmussen@....com, chris.redpath@....com,
        patrick.bellasi@....com, valentin.schneider@....com,
        vincent.guittot@...aro.org, thara.gopinath@...aro.org,
        viresh.kumar@...aro.org, tkjos@...gle.com, joelaf@...gle.com,
        smuckle@...gle.com, adharmap@...cinc.com, skannan@...cinc.com,
        pkondeti@...eaurora.org, juri.lelli@...hat.com,
        edubezval@...il.com, srinivas.pandruvada@...ux.intel.com,
        currojerez@...eup.net, javi.merino@...nel.org
Subject: Re: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management
 framework

On Tue, Jun 19, 2018 at 04:21:16PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 19, 2018 at 04:16:42PM +0200, Peter Zijlstra wrote:
> > On Tue, Jun 19, 2018 at 02:38:45PM +0100, Quentin Perret wrote:
> > > But maybe I could use something simpler than a lock in this case ?
> > > Would WRITE_ONCE/READ_ONCE be enough to ensure that atomicity for
> > > example ?
> > 
> > Yes, since its a single pointer, smp_store_release() + READ_ONCE()
> > should be sufficient (these are the foundations of RCU).
> 
> Note that per_cpu()/this_cpu_read() and friends should imply READ_ONCE().

Mark reminded me that per_cpu() does not in fact imply that, but
READ_ONCE(per_cpu()) should work.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ