On 11/2/2017 11:17 AM, Sebastian Andrzej Siewior wrote:
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…
Well, you clearly didn't read the article I sent or even what I said.
But your reasoning is a bit flawed seeing try_wait_for_completion() is
not designed to be inlined and will never be inlined unless the kernel
is compiled with link-time optimization which I don't think many people use.
Logan