From: Uladzislau Rezki <urezki@gmail.com>
To: lirongqing <lirongqing@baidu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Uladzislau Rezki <urezki@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vmalloc: use unbound workqueue for vmap area draining
Date: Wed, 18 Mar 2026 19:10:03 +0100 [thread overview]
Message-ID: <abrqe7WDcbvzvrqt@milan> (raw)
In-Reply-To: <20260318073630.2325-1-lirongqing@baidu.com>
On Wed, Mar 18, 2026 at 03:36:30AM -0400, lirongqing wrote:
> 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
>
We free memory here. Therefore it is time to switch to our
own workqueue with WQ_MEM_RECLAIM | WQ_UNBOUND flags.
--
Uladzislau Rezki
next prev parent reply other threads:[~2026-03-18 18:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 7:36 [PATCH] mm/vmalloc: use unbound workqueue for vmap area draining lirongqing
2026-03-18 18:10 ` Uladzislau Rezki [this message]
2026-03-19 2:13 ` 答复: [????] " Li,Rongqing(ACG CCN)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abrqe7WDcbvzvrqt@milan \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lirongqing@baidu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox