]> git.ipfire.org Git - thirdparty/linux.git/commit
mm/vmalloc.c: optimize code in decay_va_pool_node() a little bit
authorBaoquan He <bhe@redhat.com>
Fri, 18 Apr 2025 22:36:51 +0000 (06:36 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 13 May 2025 06:50:32 +0000 (23:50 -0700)
commit4f05024eba021f1885c044c8515b6a2674b652de
tree2884946de5aaf13e17df3a3eb0a300c43012ac41
parent81262d85aef4dbdd878d6ce982fe51c06ed2720c
mm/vmalloc.c: optimize code in decay_va_pool_node() a little bit

When purge lazily freed vmap areas, VA stored in vn->pool[] will also be
taken away into free vmap tree partially or completely accordingly, that
is done in decay_va_pool_node().  When doing that, for each pool of node,
the whole list is detached from the pool for handling.  At this time, that
pool is empty.  It's not necessary to update the pool size each time when
one VA is removed and addded into free vmap tree.

Here change code to update the pool size when attaching the pool back.

Link: https://lkml.kernel.org/r/20250418223653.243436-4-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Shivank Garg <shivankg@amd.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmalloc.c