public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Qi Zheng <qi.zheng@linux.dev>
Cc: hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev,
	shakeel.butt@linux.dev, muchun.song@linux.dev, yosry@kernel.org,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: Re: [PATCH v2] mm: memcontrol: fix rcu unbalance in get_non_dying_memcg_end()
Date: Tue, 28 Apr 2026 15:12:53 -0700	[thread overview]
Message-ID: <20260428151253.bdfb08401ebb74c438df0e52@linux-foundation.org> (raw)
In-Reply-To: <20260428103108.45719-1-qi.zheng@linux.dev>

On Tue, 28 Apr 2026 18:31:08 +0800 Qi Zheng <qi.zheng@linux.dev> wrote:

> Currently, get_non_dying_memcg_start() and get_non_dying_memcg_end() both
> evaluate cgroup_subsys_on_dfl(memory_cgrp_subsys) independently to
> determine whether to acquire or release the RCU read lock.

Sashiko review
(https://sashiko.dev/#/patchset/20260428103108.45719-1-qi.zheng@linux.dev)
is correct.

mm/memcontrol.c: In function 'mod_memcg_state':
mm/memcontrol.c:881:9: error: 'rcu_locked' is used uninitialized [-Werror=uninitialized]
  881 |         get_non_dying_memcg_end(rcu_locked);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/memcontrol.c:874:14: note: 'rcu_locked' was declared here
  874 |         bool rcu_locked;
      |              ^~~~~~~~~~
In function 'mod_memcg_lruvec_state',
    inlined from 'mod_lruvec_state' at mm/memcontrol.c:973:3:
mm/memcontrol.c:952:9: error: 'rcu_locked' is used uninitialized [-Werror=uninitialized]
  952 |         get_non_dying_memcg_end(rcu_locked);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/memcontrol.c:944:14: note: 'rcu_locked' was declared here
  944 |         bool rcu_locked;
      |              ^~~~~~~~~~
In function 'mod_memcg_state',
    inlined from 'mem_cgroup_sk_uncharge' at mm/memcontrol.c:5392:2:
mm/memcontrol.c:881:9: error: 'rcu_locked' is used uninitialized [-Werror=uninitialized]
  881 |         get_non_dying_memcg_end(rcu_locked);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/memcontrol.c:874:14: note: 'rcu_locked' was declared here
  874 |         bool rcu_locked;
      |              ^~~~~~~~~~

  parent reply	other threads:[~2026-04-28 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 10:31 [PATCH v2] mm: memcontrol: fix rcu unbalance in get_non_dying_memcg_end() Qi Zheng
2026-04-28 11:19 ` Muchun Song
2026-04-28 22:12 ` Andrew Morton [this message]
2026-04-29  2:48   ` Qi Zheng

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=20260428151253.bdfb08401ebb74c438df0e52@linux-foundation.org \
    --to=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=muchun.song@linux.dev \
    --cc=qi.zheng@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=yosry@kernel.org \
    --cc=zhengqi.arch@bytedance.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