Re: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework

From: Peter Zijlstra
Date: Tue Jun 19 2018 - 10:17:21 EST


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).