Re: [PATCH v2] mm/vmalloc: Use dedicated unbound workqueue for vmap purge/drain

Uladzislau Rezki
2026-03-31T09:39:13Z

On Mon, Mar 30, 2026 at 12:16:25PM -0700, Andrew Morton wrote:
> On Mon, 30 Mar 2026 19:58:24 +0200 "Uladzislau Rezki (Sony)" <urezki@gmail.com> wrote:
>
> > The drain_vmap_area_work() function can take >10ms to complete
> > when there are many accumulated vmap areas in a system with a
> > high CPU count, causing workqueue watchdog warnings when run
> > via schedule_work():
> >
> > [ 2069.796205] workqueue: drain_vmap_area_work hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND
> > [ 2192.823225] workqueue: drain_vmap_area_work hogged CPU for >10000us 5 times, consider switching to WQ_UNBOUND
> >
> > Switch to a dedicated WQ_UNBOUND workqueue to allow the scheduler to
> > run this background task on any available CPU, improving responsiveness.
> > Use WQ_MEM_RECLAIM to ensure forward progress under memory pressure.
> >
> > If queuing work to the dedicated workqueue is not possible(during
> > early boot), fall back to processing locally to avoid losing progress.
> >
> > Also simplify purge helper scheduling by removing cpumask-based
> > iteration in favour to iterating directly over vmap nodes with
> > pending work.
>
> Thanks. AI review flagged a couple of possible issues. Do they look
> real to you?
> https://sashiko.dev/#/patchset/20260330175824.2777270-1-urezki@gmail.com
>
I think the problem about itself locking if running by rescue thread is
a valid concern. I will address this. I think the easiest is to use two
UNBOUND queues one for master/main thread and second for helpers which
reclaim if there are too many objects so the help is needed.

I will work on v3.

Thank you for review!

--
Uladzislau Rezki