]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: remove misleading 'unlikely' hint in vms_gather_munmap_vmas()
authorBreno Leitao <leitao@debian.org>
Fri, 4 Oct 2024 16:48:31 +0000 (09:48 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:28:58 +0000 (21:28 -0700)
commit0325087c5aa884afec92b67fe63b7dc60b1eb030
tree28cbdb1419164b683e523489a2b8aaad23fb9462
parenta43e8e995230371cd191069984349aa6cf015fe4
mm: remove misleading 'unlikely' hint in vms_gather_munmap_vmas()

Performance analysis using branch annotation on a fleet of 200 hosts
running web servers revealed that the 'unlikely' hint in
vms_gather_munmap_vmas() was 100% consistently incorrect.  In all observed
cases, the branch behavior contradicted the hint.

Remove the 'unlikely' qualifier from the condition checking 'vms->uf'.  By
doing so, we allow the compiler to make optimization decisions based on
its own heuristics and profiling data, rather than relying on a static
hint that has proven to be inaccurate in real-world scenarios.

Link: https://lkml.kernel.org/r/20241004164832.218681-1-leitao@debian.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vma.c