linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Qian Cai <cai@lca.pw>
Cc: akpm@linux-foundation.org, elver@google.com, jhubbard@nvidia.com,
	ira.weiny@intel.com, dan.j.williams@intel.com, jack@suse.cz,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next v2] mm: mark an intentional data race in page_zonenum
Date: Thu, 6 Feb 2020 12:20:05 -0800	[thread overview]
Message-ID: <20200206202005.GY8731@bombadil.infradead.org> (raw)
In-Reply-To: <20200206183000.913-1-cai@lca.pw>

On Thu, Feb 06, 2020 at 01:30:00PM -0500, Qian Cai wrote:
> Both the read and write are done only with the non-exclusive mmap_sem
> held. Since the read only check for a specific bit range (up to 3 bits)
> in the flag but the write here never change those 3 bits, so load
> tearing would be harmless here. Thus, just mark it as an intentional
> data races using the data_race() macro which is designed for those
> situations [1].

This changelog makes me think you don't really understand the situation.

A page never changes its zone number.  The zone number happens to be
stored in the same word as other bits which are modified, but the zone
number bits will never be modified by any other write.  So we can accept
a reload of the zone bits after an intervening write and we don't need
to use READ_ONCE().

  reply	other threads:[~2020-02-06 20:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 18:30 [PATCH -next v2] mm: mark an intentional data race in page_zonenum Qian Cai
2020-02-06 20:20 ` Matthew Wilcox [this message]
2020-02-06 20:25   ` Qian Cai
2020-02-10  2:20     ` Andrew Morton
2020-02-10  2:41       ` Qian Cai
2020-02-10  4:06         ` Andrew Morton
2020-02-10  7:58           ` Marco Elver

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=20200206202005.GY8731@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=dan.j.williams@intel.com \
    --cc=elver@google.com \
    --cc=ira.weiny@intel.com \
    --cc=jack@suse.cz \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).