Re: [PATCH v1 16/26] mm: thp: prevent memory cgroup release in folio_split_queue_lock{_irqsave}()
From: Harry Yoo
Date: Thu Nov 20 2025 - 03:54:15 EST
On Tue, Oct 28, 2025 at 09:58:29PM +0800, Qi Zheng wrote:
> From: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
>
> In the near future, a folio will no longer pin its corresponding memory
> cgroup. To ensure safety, it will only be appropriate to hold the rcu read
> lock or acquire a reference to the memory cgroup returned by
> folio_memcg(), thereby preventing it from being released.
>
> In the current patch, the rcu read lock is employed to safeguard against
> the release of the memory cgroup in folio_split_queue_lock{_irqsave}().
>
> Signed-off-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> ---
Looks good to me,
Reviewed-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
Yeah, once we acquire the split-queue lock, the split queue won't
disappear under us because the reparenting logic also takes the same
lock before reparenting.
--
Cheers,
Harry / Hyeonggon