lkml.org 
[lkml]   [2018]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework
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().

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