On 2017-11-02 10:03:53 [-0600], Logan Gunthorpe wrote: > On 11/2/2017 9:07 AM, Sebastian Andrzej Siewior wrote: > > Why so? There is no way the compiler could have cached the value > > somehow. > > Well, I think it would be sufficient to notice that the code you were > replacing used a READ_ONCE and you're putting it into a function that's a > bit more complicated. But I'd suggest you read [1] which essentially says > that all shared variables should be accessed with such a macro even if only > to document that it's a part of a thread synchronization protocol. It used READ_ONCE in case the code would have been inlined within a loop which makes sense to some degree. It is not the case here. But hey I can add, no problem… > Logan Sebastian