Re: [PATCH RT] mm/memcg: Fix recursive locking on refill_stock() on PREEMPT_RT

Sebastian Andrzej Siewior <[email protected]> Thu, 17 Aug 2023 11:12:24 +0200
Newsgroups org.kernel.vger.stable-rt,org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rt-users,org.kvack.linux-mm
Message-ID <[email protected]>
On 2023-08-10 15:05:34 [-0400], Zachary Goldstein via B4 Relay wrote:
> From: Zachary Goldstein <[email protected]>
> 
> 5.10 suffers from the same recursive locking issue that
> commit a848d25434de4 ("mm/memcg: Opencode the inner part of
> obj_cgroup_uncharge_pages() in drain_obj_stock()") fixes.

This is the commit id from the stable-rt tree for the v5.15 series.
The original commit was af9a3b69e84be ("mm/memcg: opencode the inner
part of obj_cgroup_uncharge_pages() in drain_obj_stock()").

> Modified description from the commit to reflect this patch changes:
> 
> Provide the inner part of refill_stock() as __refill_stock() without
> disabling interrupts. This eases the integration of local_lock_t where
> recursive locking must be avoided.
> Open code __memcg_kmem_uncharge() in drain_obj_stock() and
> obj_cgroup_release() and use __refill_stock(). The caller of
> drain_obj_stock() and obj_cgroup_release() already disables interrupts.
> 
> Signed-off-by: Zachary Goldstein <[email protected]>

I would prefer a proper backport similar to the commit you mentioned.
This would include keeping the author ship and so on.
The change itself looks okay.

Sebastian