linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: Marco Elver <elver@google.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] mm/page_counter: mark intentional data races
Date: Wed, 29 Jan 2020 04:51:58 -0500	[thread overview]
Message-ID: <9507ADF5-1040-495E-9A39-C0C23412AD64@lca.pw> (raw)
In-Reply-To: <CANpmjNNaCtL+vqpPKug9_DoFUue=PdoTyQFXLOx5H_BYCyDMzA@mail.gmail.com>



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

      parent reply	other threads:[~2020-01-29  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29  4:20 Qian Cai
2020-01-29  8:51 ` Michal Hocko
2020-01-29  9:06   ` Marco Elver
2020-01-29  9:33     ` Qian Cai
2020-01-29  9:51     ` Qian Cai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9507ADF5-1040-495E-9A39-C0C23412AD64@lca.pw \
    --to=cai@lca.pw \
    --cc=akpm@linux-foundation.org \
    --cc=elver@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox