[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3E1FB0B8-F499-45F7-9B03-7B80395FFF19@lca.pw>
Date: Thu, 6 Feb 2020 06:14:55 -0500
From: Qian Cai <cai@....pw>
To: Jan Kara <jack@...e.cz>
Cc: John Hubbard <jhubbard@...dia.com>, akpm@...ux-foundation.org,
ira.weiny@...el.com, dan.j.williams@...el.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] mm: mark a intentional data race in page_zonenum()
> On Feb 6, 2020, at 4:04 AM, Jan Kara <jack@...e.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.
Powered by blists - more mailing lists