Re: [PATCH] sched: Remove ACCESS_ONCE() for jiffies

David Rientjes
2014-08-12T22:11:29Z

On Tue, 12 Aug 2014, Pranith Kumar wrote:

> It looks more like an inconsistency. These are the only three places
> which use ACCESS_ONCE() for jiffies. Also, in doc/memory-barriers.txt,
> it explicitly states that ACCESS_ONCE(jiffies) is not necessary. I
> grepped for this usage after reading that document just to make sure
> and found these three uses.
>
> But yes, there is no harm being done by using ACCESS_ONCE().
>

One could argue that doing ACCESS_ONCE(jiffies) is always better because
of the context it which it is used rather than qualifying jiffies itself
as volatile.