Re: [PATCH] mm: memcontrol: fix NULL pointer deref in high_work_func() on dying memcg
From: Shakeel Butt
Date: Tue Oct 27 2026 - 14:09:46 EST
On Tue, Oct 27, 2026 at 10:28:22AM -0700, T.J. Mercier wrote:
> On Tue, Oct 27, 2026 at 2:41 AM Michal Hocko <mhocko@xxxxxxxx> wrote:
> >
> > On Mon 26-10-26 11:01:51, T.J. Mercier wrote:
> > > On Mon, Oct 26, 2026 at 6:25 AM Michal Hocko <mhocko@xxxxxxxx> wrote:
> > > >
[...]
> > > > On Fri 23-10-26 15:23:13, T.J. Mercier wrote:
> > I must be missing something really obvious here because I really do not
> > follow you here too. So we are offlining a memcg. We need to coordinate
> > memory reclaim with the memcg tear down, right? For the high reclaim we
> > can achieve this synchronization through disable_work_sync in
> > mem_cgroup_css_offline.
>
> We could call disable_work_sync() in mem_cgroup_css_offline(), but
> that waits until high_work_func() is done and it could be performing
> reclaim. mem_cgroup_css_offline() runs under the cgroup_mutex, and
> cgroup_mutex contention is already bad enough. I don't want to add to
> it. It would also block the rest of the cgroup_offline_wq.
+1, let's not add more potential contention sources for cgroup_mutex.