public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: "Li,Rongqing(ACG CCN)" <lirongqing@baidu.com>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 答复: [????] Re: ??: [????] Re: [PATCH v2] mm/vmalloc: use dedicated unbound workqueue for vmap area draining
Date: Fri, 20 Mar 2026 05:48:46 +0000	[thread overview]
Message-ID: <b85047633c5b47c19db52d68001d632f@baidu.com> (raw)
In-Reply-To: <abv42QtTuwJCv1St@milan>

> That is true.
> 
> <snip>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c index
> 61caa55a4402..81e1e74346d5 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1067,6 +1067,7 @@ static void reclaim_and_purge_vmap_areas(void);
>  static BLOCKING_NOTIFIER_HEAD(vmap_notify_list);
>  static void drain_vmap_area_work(struct work_struct *work);  static
> DECLARE_WORK(drain_vmap_work, drain_vmap_area_work);
> +static struct workqueue_struct *drain_vmap_wq;
> 
>  static __cacheline_aligned_in_smp atomic_long_t nr_vmalloc_pages;  static
> __cacheline_aligned_in_smp atomic_long_t vmap_lazy_nr; @@ -2437,6
> +2438,17 @@ static void drain_vmap_area_work(struct work_struct *work)
>  	mutex_unlock(&vmap_purge_lock);
>  }
> 
> +static void
> +schedule_drain_vmap_work(unsigned long nr_lazy, unsigned long
> +nr_lazy_max) {
> +	if (unlikely(nr_lazy > nr_lazy_max)) {
> +		struct workqueue_struct *wq = READ_ONCE(drain_vmap_wq);
> +
> +		if (wq)
> +			queue_work(wq, &drain_vmap_work);
> +	}
> +}
> +
>  /*
>   * Free a vmap area, caller ensuring that the area has been unmapped,
>   * unlinked and flush_cache_vunmap had been called for the correct @@
> -2470,8 +2482,7 @@ static void free_vmap_area_noflush(struct vmap_area
> *va)
>  	trace_free_vmap_area_noflush(va_start, nr_lazy, nr_lazy_max);
> 
>  	/* After this point, we may free va at any time */
> -	if (unlikely(nr_lazy > nr_lazy_max))
> -		schedule_work(&drain_vmap_work);
> +	schedule_drain_vmap_work(nr_lazy, nr_lazy_max);
>  }
> 
>  /*
> @@ -5483,3 +5494,15 @@ void __init vmalloc_init(void)
>  	vmap_node_shrinker->scan_objects = vmap_node_shrink_scan;
>  	shrinker_register(vmap_node_shrinker);
>  }
> +
> +static int __init vmalloc_init_workqueue(void) {
> +	struct workqueue_struct *wq;
> +
> +	wq = alloc_workqueue("vmap_drain", WQ_UNBOUND |
> WQ_MEM_RECLAIM, 0);
> +	WARN_ON(wq == NULL);
> +	WRITE_ONCE(drain_vmap_wq, wq);
> +
> +	return 0;
> +}
> +early_initcall(vmalloc_init_workqueue);
> <snip>
> 

I test the upper codes, it works for me, Do you like to send a formal patch?

Reported-and-tested-by: Li RongQing <lirongqing@baidu.com>

thanks

[Li,Rongqing] 


> --
> Uladzislau Rezki

  reply	other threads:[~2026-03-20  5:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  7:43 [PATCH v2] mm/vmalloc: use dedicated unbound workqueue for vmap area draining lirongqing
2026-03-19  9:39 ` Uladzislau Rezki
2026-03-19 10:05   ` 答复: [????] " Li,Rongqing(ACG CCN)
2026-03-19 13:23     ` Uladzislau Rezki
2026-03-20  5:48       ` Li,Rongqing(ACG CCN) [this message]
2026-03-20  3:16 ` Andrew Morton
2026-03-20  9:51 ` [syzbot ci] " syzbot ci
2026-03-24 13:32 ` [PATCH v2] " kernel test robot

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=b85047633c5b47c19db52d68001d632f@baidu.com \
    --to=lirongqing@baidu.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=urezki@gmail.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