[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zp6cVgXJlzF4VOwl@slm.duckdns.org>
Date: Mon, 22 Jul 2024 07:52:22 -1000
From: Tejun Heo <tj@...nel.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: kernel test robot <oliver.sang@...el.com>,
Suren Baghdasaryan <surenb@...gle.com>, oe-lkp@...ts.linux.dev,
lkp@...el.com, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Kent Overstreet <kent.overstreet@...ux.dev>,
Kees Cook <keescook@...omium.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Alex Gaynor <alex.gaynor@...il.com>,
Alice Ryhl <aliceryhl@...gle.com>,
Andreas Hindborg <a.hindborg@...sung.com>,
Benno Lossin <benno.lossin@...ton.me>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Christoph Lameter <cl@...ux.com>, Dennis Zhou <dennis@...nel.org>,
Gary Guo <gary@...yguo.net>, Miguel Ojeda <ojeda@...nel.org>,
Pasha Tatashin <pasha.tatashin@...een.com>,
Peter Zijlstra <peterz@...radead.org>,
Vlastimil Babka <vbabka@...e.cz>,
Wedson Almeida Filho <wedsonaf@...il.com>, linux-mm@...ck.org,
lkmm@...ts.linux.dev
Subject: Re: [linus:master] [mm] 24e44cc22a:
BUG:KCSAN:data-race_in_pcpu_alloc_noprof/pcpu_block_update_hint_alloc
On Mon, Jul 22, 2024 at 10:47:30AM -0700, Boqun Feng wrote:
> This looks like a data race because we read pcpu_nr_empty_pop_pages out
> of the lock for a best effort checking, @Tejun, maybe you could confirm
> on this?
That does sound plausible.
> - if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW)
> + /*
> + * Checks pcpu_nr_empty_pop_pages out of the pcpu_lock, data races may
> + * occur but this is just a best-effort checking, everything is synced
> + * in pcpu_balance_work.
> + */
> + if (data_race(pcpu_nr_empty_pop_pages) < PCPU_EMPTY_POP_PAGES_LOW)
> pcpu_schedule_balance_work();
Would it be better to use READ/WRITE_ONCE() for the variable?
Thanks.
--
tejun
Powered by blists - more mailing lists