[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <6E237CA6-8968-4207-A9BB-1D18CB30822B@lca.pw>
Date: Sun, 9 Feb 2020 23:44:26 -0500
From: Qian Cai <cai@....pw>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: hannes@...xchg.org, mhocko@...nel.org, vdavydov.dev@...il.com,
cgroups@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/memcontrol: fix a data race in scan count
> On Feb 9, 2020, at 11:28 PM, Andrew Morton <akpm@...ux-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.
Powered by blists - more mailing lists