From: Qian Cai <cai@lca.pw>
To: Jan Kara <jack@suse.cz>
Cc: John Hubbard <jhubbard@nvidia.com>,
akpm@linux-foundation.org, ira.weiny@intel.com,
dan.j.williams@intel.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] mm: mark a intentional data race in page_zonenum()
Date: Thu, 6 Feb 2020 06:14:55 -0500 [thread overview]
Message-ID: <3E1FB0B8-F499-45F7-9B03-7B80395FFF19@lca.pw> (raw)
In-Reply-To: <20200206090436.GF14001@quack2.suse.cz>
> On Feb 6, 2020, at 4:04 AM, Jan Kara <jack@suse.cz> wrote:
>
> So in this particular case, store tearing is non-issue because we use
> atomic operation to store the value in page_cpupid_xchg_last(). I think it
> would make some sense to use READ_ONCE(page->flags) here to prevent
> compiler from loading page->flags several times - I have hard time finding
> a reason why a compiler would want to do that but conceptually that
> protection makes sense, it is for free performance wise, and will still
> allow KCSAN to find a race in case we ever grow a place that modifies
> page's zone non-atomically (which might be a real problem). And it should
> also silence the KCSAN warning AFAIU.
Ah, read up to 3 bits might be an issue then. I’ll post an alternative version which uses READ_ONCE() just for the old page ( because the new page has not been published yet) in wp_page_copy() then.
next prev parent reply other threads:[~2020-02-06 11:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 3:52 Qian Cai
2020-02-06 4:50 ` John Hubbard
2020-02-06 9:04 ` Jan Kara
2020-02-06 11:14 ` Qian Cai [this message]
2020-02-06 14:01 ` Qian Cai
2020-02-06 14:35 ` Marco Elver
2020-02-06 23:18 ` John Hubbard
2020-02-07 13:18 ` 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=3E1FB0B8-F499-45F7-9B03-7B80395FFF19@lca.pw \
--to=cai@lca.pw \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.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