public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH] mm/vmalloc: use unbound workqueue for vmap area draining
@ 2026-03-18  7:36 lirongqing
  2026-03-18 18:10 ` Uladzislau Rezki
  0 siblings, 1 reply; 3+ messages in thread
From: lirongqing @ 2026-03-18  7:36 UTC (permalink / raw)
  To: Andrew Morton, Uladzislau Rezki, linux-mm, linux-kernel; +Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

The workqueue watchdog currently reports that drain_vmap_area_work
hogs the CPU for more than 10ms. This typically happens during heavy
memory pressure or high-frequency vmap/vunmap operations where the lazy
drain list grows large.

[ 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
[ 3225.388966] workqueue: drain_vmap_area_work hogged CPU for >10000us 7 times, consider switching to WQ_UNBOUND

Since vmap area draining is a background housekeeping task that does
not require strict CPU affinity or cache locality, it is a prime
candidate for an unbound workqueue.

Switching from schedule_work() to queue_work(system_unbound_wq, ...)
allows the scheduler to offload the draining process to any available
CPU core. This prevents stalling the current CPU and resolves the
"consider switching to WQ_UNBOUND" warning.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 61caa55..5f2218a 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2471,7 +2471,7 @@ static void free_vmap_area_noflush(struct vmap_area *va)
 
 	/* After this point, we may free va at any time */
 	if (unlikely(nr_lazy > nr_lazy_max))
-		schedule_work(&drain_vmap_work);
+		queue_work(system_unbound_wq, &drain_vmap_work);
 }
 
 /*
-- 
2.9.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-19  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18  7:36 [PATCH] mm/vmalloc: use unbound workqueue for vmap area draining lirongqing
2026-03-18 18:10 ` Uladzislau Rezki
2026-03-19  2:13   ` 答复: [????] " Li,Rongqing(ACG CCN)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox