Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: stable@vger.kernel.org, Sasha Levin <sashal@kernel.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>,
	Baoquan He <baoquan.he@linux.dev>,
	chenyichong <chenyichong@uniontech.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.12.y] mm/vmalloc: take vmap_purge_lock in shrinker
Date: Mon, 06 Jul 2026 18:37:30 +0200	[thread overview]
Message-ID: <10194326.ag9G3TJQzC@diego> (raw)
In-Reply-To: <20260508191051.1831166-1-sashal@kernel.org>

Hi,

Am Freitag, 8. Mai 2026, 21:10:50 Mitteleuropäische Sommerzeit schrieb Sasha Levin:
> From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
> 
> [ Upstream commit ec05f51f1e65bce95528543eb73fda56fd201d94 ]
> 
> decay_va_pool_node() can be invoked concurrently from two paths:
> __purge_vmap_area_lazy() when pools are being purged, and the shrinker via
> vmap_node_shrink_scan().
> 
> However, decay_va_pool_node() is not safe to run concurrently, and the
> shrinker path currently lacks serialization, leading to races and possible
> leaks.
> 
> Protect decay_va_pool_node() by taking vmap_purge_lock in the shrinker
> path to ensure serialization with purge users.
> 
> Link: https://lore.kernel.org/20260413192646.14683-1-urezki@gmail.com
> Fixes: 7679ba6b36db ("mm: vmalloc: add a shrinker to drain vmap pools")
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> Reviewed-by: Baoquan He <baoquan.he@linux.dev>
> Cc: chenyichong <chenyichong@uniontech.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> [ kept index-based loop instead of for_each_vmap_node() helper ]
> Signed-off-by: Sasha Levin <sashal@kernel.org>

it seems this fell through the cracks?

Because I don't see an applied message and couldn't find it in a 6.12
release up to now as well.

Would be nice to have in 6.12 though :-)


Thanks
Heiko

> ---
>  mm/vmalloc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 1d2262fb54185..d4a42980b4d02 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -5204,6 +5204,7 @@ vmap_node_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
>  {
>  	int i;
>  
> +	guard(mutex)(&vmap_purge_lock);
>  	for (i = 0; i < nr_vmap_nodes; i++)
>  		decay_va_pool_node(&vmap_nodes[i], true);
>  
> 





  reply	other threads:[~2026-07-06 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03 11:49 FAILED: patch "[PATCH] mm/vmalloc: take vmap_purge_lock in shrinker" failed to apply to 6.12-stable tree gregkh
2026-05-08 19:10 ` [PATCH 6.12.y] mm/vmalloc: take vmap_purge_lock in shrinker Sasha Levin
2026-07-06 16:37   ` Heiko Stübner [this message]
2026-07-07  8:50     ` Sasha Levin

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=10194326.ag9G3TJQzC@diego \
    --to=heiko@sntech.de \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=chenyichong@uniontech.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.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