stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [alternative-merged] mm-vmalloc-fix-regression-caused-by-needless-vmalloc_sync_all.patch removed from -mm tree
@ 2019-11-15 23:36 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2019-11-15 23:36 UTC (permalink / raw)
  To: cai, dave.hansen, jroedel, mm-commits, shile.zhang, stable, tglx


The patch titled
     Subject: mm/vmalloc: fix performance regression caused by needless vmalloc_sync_all()
has been removed from the -mm tree.  Its filename was
     mm-vmalloc-fix-regression-caused-by-needless-vmalloc_sync_all.patch

This patch was dropped because an alternative patch was merged

------------------------------------------------------
From: Shile Zhang <shile.zhang@linux.alibaba.com>
Subject: mm/vmalloc: fix performance regression caused by needless vmalloc_sync_all()

vmalloc_sync_all() was put in the common path in __purge_vmap_area_lazy(),
for one sync issue only happened on X86_32 with PTI enabled.  It is
needless for X86_64, which caused a big regression in UnixBench Shell8
testing on X86_64.  Similar regression also reported by 0-day kernel test
robot in reaim benchmarking:
https://lists.01.org/hyperkitty/list/lkp@lists.01.org/thread/4D3JPPHBNOSPFK2KEPC6KGKS6J25AIDB/

Fix it by adding more conditions.

[akpm@linux-foundation.org: simplify config expression, use IS_ENABLED()]
[akpm@linux-foundation.org: build fix - go back to using an ifdef]
Link: http://lkml.kernel.org/r/20191113095530.228959-1-shile.zhang@linux.alibaba.com
Fixes: 3f8fd02b1bf1 ("mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()")
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Qian Cai <cai@lca.pw>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/vmalloc.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/mm/vmalloc.c~mm-vmalloc-fix-regression-caused-by-needless-vmalloc_sync_all
+++ a/mm/vmalloc.c
@@ -1255,11 +1255,17 @@ static bool __purge_vmap_area_lazy(unsig
 	if (unlikely(valist == NULL))
 		return false;
 
+#ifdef CONFIG_X86_PAE
 	/*
-	 * First make sure the mappings are removed from all page-tables
-	 * before they are freed.
+	 * First make sure the mappings are removed from all pagetables before
+	 * they are freed.
+	 *
+	 * This is only needed on x86-32 with !SHARED_KERNEL_PMD, which is the
+	 * case on a PAE kernel with PTI enabled.
 	 */
-	vmalloc_sync_all();
+	if (!SHARED_KERNEL_PMD && boot_cpu_has(X86_FEATURE_PTI))
+		vmalloc_sync_all();
+#endif
 
 	/*
 	 * TODO: to calculate a flush range without looping.
_

Patches currently in -mm which might be from shile.zhang@linux.alibaba.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-15 23:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 23:36 [alternative-merged] mm-vmalloc-fix-regression-caused-by-needless-vmalloc_sync_all.patch removed from -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).