linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Liu Shixin <liushixin2@huawei.com>
Cc: "Paul E . McKenney" <paulmck@kernel.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/vmstat: annotate data race for zone->free_area[order].nr_free
Date: Tue, 14 Sep 2021 21:10:27 -0700	[thread overview]
Message-ID: <20210914211027.0d612d99a94b085112ba0969@linux-foundation.org> (raw)
In-Reply-To: <20210908015606.3999871-1-liushixin2@huawei.com>

On Wed, 8 Sep 2021 09:56:06 +0800 Liu Shixin <liushixin2@huawei.com> wrote:

> KCSAN reports a data-race on v5.10 which also exists on mainline:
> 
> ==================================================================
> BUG: KCSAN: data-race in extfrag_for_order+0x33/0x2d0
> 
> race at unknown origin, with read to 0xffff9ee9bfffab48 of 8 bytes by task 34 on cpu 1:
>  extfrag_for_order+0x33/0x2d0
>  kcompactd+0x5f0/0xce0
>  kthread+0x1f9/0x220
>  ret_from_fork+0x22/0x30
> 
> Reported by Kernel Concurrency Sanitizer on:
> CPU: 1 PID: 34 Comm: kcompactd0 Not tainted 5.10.0+ #2
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
> ==================================================================
> 
> Access to zone->free_area[order].nr_free in extfrag_for_order()/frag_show_print()
> is lockless. That's intentional and the stats are a rough estimate anyway.
> Annotate them with data_race().

checkpatch helpfully says

WARNING: data_race without comment
#40: FILE: mm/vmstat.c:1074:
+               blocks = data_race(zone->free_area[order].nr_free);


can we please add a comment ;)


      reply	other threads:[~2021-09-15  4:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08  1:56 Liu Shixin
2021-09-15  4:10 ` Andrew Morton [this message]

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=20210914211027.0d612d99a94b085112ba0969@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liushixin2@huawei.com \
    --cc=paulmck@kernel.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