lkml.org 
[lkml]   [2020]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -next] mm/page_counter: mark intentional data races
Date


> On Jan 29, 2020, at 4:06 AM, Marco Elver <elver@google.com> wrote:
>
> These should be using 'READ_ONCE' and 'WRITE_ONCE' for c->watermark.
> Store or load tearing would change the logic here, since the
> comparison might see garbage.

I originally thought that it probably does not matter because it is racy there by doing lockless access anyway. Another thread could change the value at anytime.

Now, I agree set it to a garbage due to a data race could be quite unpleasant there.
\
 
 \ /
  Last update: 2020-01-29 10:52    [W:0.432 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site