Re: [PATCH v2 3/5] memcg: use high_work for kernel threads
From: Muchun Song
Date: Fri Oct 30 2026 - 20:48:28 EST
> On Oct 31, 2026, at 04:54, Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
>
> Kernel threads never return to userspace, so deferred memory.high
> reclaim does not run. Reclaim and throttling during a charge can also
> delay work they do for other tasks.
>
> Treat kernel threads like interrupts. Queue high_work for the first
> cgroup over memory.high and skip reclaim and throttling in the charging
> thread.
>
> User workers created by create_io_thread() and vhost_task_create() keep
> their current behavior. Vhost kernel threads use the new path, even when
> they borrow the owner's mm.
>
> The worker requests a fixed batch of pages each time. A fast allocator
> can keep usage well above memory.high. Kernel threads also skip
> memory.swap.high throttling and its high-event reporting. The memory.max
> and memory.swap.max checks stay the same.
>
> Suggested-by: Tejun Heo <tj@xxxxxxxxxx>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Acked-by: Muchun Song <muchun.song@xxxxxxxxx>
THanks.