From: Qian Cai <cai@lca.pw>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memcontrol: fix a data race in scan count
Date: Sun, 9 Feb 2020 23:44:26 -0500 [thread overview]
Message-ID: <6E237CA6-8968-4207-A9BB-1D18CB30822B@lca.pw> (raw)
In-Reply-To: <20200209202840.2bf97ffcfa811550d733c461@linux-foundation.org>
> On Feb 9, 2020, at 11:28 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> I worry about the readability/maintainability of these things. A naive
> reader who comes upon this code will wonder "why the heck is it using
> READ_ONCE?". A possibly lengthy trawl through the git history will
> reveal the reason but that's rather unkind. Wouldn't a simple
>
> /* modified under lru_lock, so use READ_ONCE */
>
> improve the situation?
Sure. I just don’t remember there are many places in the existing code which put comments for READ_ONCE() and WRITE_ONCE(). For example, kernel/locking/osq_lock.c and kernel/rcu/srcutree.c, but I suppose every subsystem could be different.
prev parent reply other threads:[~2020-02-10 4:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 3:49 Qian Cai
2020-02-10 4:28 ` Andrew Morton
2020-02-10 4:44 ` Qian Cai [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=6E237CA6-8968-4207-A9BB-1D18CB30822B@lca.pw \
--to=cai@lca.pw \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=vdavydov.dev@gmail.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