Re: [PATCH v4 03/17] mm/memcg: add folio-based lruvec live helper
From: Harry Yoo
Date: Mon Oct 19 2026 - 11:17:11 EST
On Mon, Oct 19, 2026 at 02:46:37PM +0100, Harry Yoo wrote:
> In the function, RCU is the only mechanism that prevents release of
> the memcg
Uh, no. looking at the code again I might have been confused!
The caller is expected to have either 1) acquired RCU read lock,
or 2) have a reference to the cgroup.
I see a bunch of callers that acquires rcu_read_lock() before reading
memcg/lruvec from folio and passing it to mod_lruvec_state() (and then
get_non_dying_memcg_start()/end().
Callers like reclaim e.g.) mem_cgroup_iter() hold a reference to the
cgroup...
--
Cheers,
Harry / Hyeonggon