From: Qian Cai <cai@lca.pw>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Marco Elver <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 15:25:41 -0500 [thread overview]
Message-ID: <95A69596-D5F9-41EB-84A0-AE32D17FE320@lca.pw> (raw)
In-Reply-To: <20200206202005.GY8731@bombadil.infradead.org>
> On Feb 6, 2020, at 3:20 PM, Matthew Wilcox <willy@infradead.org> wrote:
>
> 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().
Maybe your explanation is better, but I did try to explain the same thing.
I’ll let Andrew to decide if he would like to update the commit log a bit
with your wording.
next prev parent reply other threads:[~2020-02-06 20:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 18:30 Qian Cai
2020-02-06 20:20 ` Matthew Wilcox
2020-02-06 20:25 ` Qian Cai [this message]
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=95A69596-D5F9-41EB-84A0-AE32D17FE320@lca.pw \
--to=cai@lca.pw \
--cc=akpm@linux-foundation.org \
--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 \
--cc=willy@infradead.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