+22
−28
Loading
mainline inclusion from mainline-v6.10-rc1 commit aaab830ad887629156ef17097c2ad24ce6fb8177 category: performance bugzilla: https://gitee.com/openeuler/kernel/issues/IAI0KD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aaab830ad887629156ef17097c2ad24ce6fb8177 -------------------------------- When allocating a new memory area where the mapping address range is known, it is observed that the vmap_node->busy.lock is acquired twice. The first acquisition occurs in the alloc_vmap_area() function when inserting the vm area into the vm mapping red-black tree. The second acquisition occurs in the setup_vmalloc_vm() function when updating the properties of the vm, such as flags and address, etc. Combine these two operations together in alloc_vmap_area(), which improves scalability when the vmap_node->busy.lock is contended. By doing so, the need to acquire the lock twice can also be eliminated to once. With the above change, tested on intel sapphire rapids platform(224 vcpu), a 4% performance improvement is gained on stress-ng/pthread(https://github.com/ColinIanKing/stress-ng), which is the stress test of thread creations. Link: https://lkml.kernel.org/r/20240307021440.64967-1-rulin.huang@intel.com Co-developed-by:"Chen, Tim C" <tim.c.chen@intel.com> Signed-off-by:
"Chen, Tim C" <tim.c.chen@intel.com> Co-developed-by:
"King, Colin" <colin.king@intel.com> Signed-off-by:
"King, Colin" <colin.king@intel.com> Signed-off-by:
rulinhuang <rulin.huang@intel.com> Reviewed-by:
Baoquan He <bhe@redhat.com> Reviewed-by:
Uladzislau Rezki (Sony) <urezki@gmail.com> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Lorenzo Stoakes <lstoakes@gmail.com> Cc: Wangyang Guo <wangyang.guo@intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
ZhangPeng <zhangpeng362@huawei.com>