linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <quic_qiancai@quicinc.com>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: <akpm@linux-foundation.org>, <david@redhat.com>,
	<ying.huang@intel.com>, <songmuchun@bytedance.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] mm/swapfile: fix possible data races of inuse_pages
Date: Mon, 27 Jun 2022 08:43:14 -0400	[thread overview]
Message-ID: <Yrml4mB3sa5fZVJa@qian> (raw)
In-Reply-To: <20220625093346.48894-2-linmiaohe@huawei.com>

On Sat, Jun 25, 2022 at 05:33:45PM +0800, Miaohe Lin wrote:
> si->inuse_pages could still be accessed concurrently now. The plain reads
> outside si->lock critical section, i.e. swap_show and si_swapinfo, which
> results in data races. READ_ONCE and WRITE_ONCE is used to fix such data
> races. Note these data races should be ok because they're just used for
> showing swap info.

Was this found by kcsan? If so, it would be useful to record the exact
kscan report in the commit message.


  parent reply	other threads:[~2022-06-27 12:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25  9:33 [PATCH v3 0/2] A few cleanup and fixup patches for swap Miaohe Lin
2022-06-25  9:33 ` [PATCH v3 1/2] mm/swapfile: fix possible data races of inuse_pages Miaohe Lin
2022-06-27  1:29   ` Huang, Ying
2022-06-27 12:43   ` Qian Cai [this message]
2022-06-27 13:27     ` Miaohe Lin
2022-06-27 13:47       ` Qian Cai
2022-06-28  1:56         ` Huang, Ying
2022-06-25  9:33 ` [PATCH v3 2/2] mm/swap: remove swap_cache_info statistics Miaohe Lin

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=Yrml4mB3sa5fZVJa@qian \
    --to=quic_qiancai@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=songmuchun@bytedance.com \
    --cc=ying.huang@intel.com \
    /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