Re: [PATCH v3] mm/vmalloc: Use dedicated unbound workqueues for vmap drain
From: Uladzislau Rezki
Date: Thu Apr 02 2026 - 12:09:42 EST
On Thu, Apr 02, 2026 at 08:23:10AM +0800, Baoquan He wrote:
> On 03/31/26 at 10:23pm, Uladzislau Rezki (Sony) wrote:
> > drain_vmap_area_work() function can take >10ms to complete
> > when there are many accumulated vmap areas in a system with
> > high CPU count, causing workqueue watchdog warnings when run
> > via schedule_work():
> >
> > workqueue: drain_vmap_area_work hogged CPU for >10000us
> >
> > Move the top-level drain work to a dedicated WQ_UNBOUND
> > workqueue so the scheduler can run this background work
> > on any available CPU, improving responsiveness. Use the
> > WQ_MEM_RECLAIM to ensure forward progress under memory
> > pressure.
> >
> > Move purge helpers to separate WQ_UNBOUND | WQ_MEM_RECLAIM
> > workqueue. This allows drain_vmap_work to wait for helpers
> > completion without creating dependency on the same rescuer
> > thread and avoid a potential parent/child deadlock.
> >
> > Simplify purge helper scheduling by removing cpumask-based
> > iteration to iterating directly over vmap nodes checking
> > work_queued state.
> >
> > Cc: stable@xxxxxxxxxxxxxxx
> > Cc: lirongqing <lirongqing@xxxxxxxxx>
> > Fixes: 72210662c5a2 ("mm: vmalloc: offload free_vmap_area_lock lock")
> > Link: https://lore.kernel.org/all/20260319074307.2325-1-lirongqing@xxxxxxxxx/
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
> > ---
> > mm/vmalloc.c | 79 ++++++++++++++++++++++++++++++++++------------------
> > 1 file changed, 52 insertions(+), 27 deletions(-)
>
> LGTM,
>
> Reviewed-by: Baoquan He <bhe@xxxxxxxxxx>
>
Thanks!
--
Uladzislau Rezki