lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210719010845.31898-1-chanho.min@lge.com>
Date:   Mon, 19 Jul 2021 10:08:45 +0900
From:   Chanho Min <chanho.min@....com>
To:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org
Cc:     linux-kernel@...r.kernel.org,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
        Gunho Lee <gunho.lee@....com>, Juneho Choi <juno.choi@....com>,
        Inkyu Hwang <inkyu.hwang@....com>,
        Chanho Min <chanho.min@....com>
Subject: [PATCH] mm: make falutaround selectable

While faultaround can have performance gains, on certain platform it
increases pss and causes swap to occur more frequently. This patch allows
to unselect faultaround on platforms that do not want this behavior.

Signed-off-by: Chanho Min <chanho.min@....com>
---
 mm/Kconfig  | 6 ++++++
 mm/memory.c | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index 39a6a977537d..8f834386e7f3 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -750,4 +750,10 @@ config ARCH_HAS_PTE_SPECIAL
 config ARCH_HAS_HUGEPD
 	bool
 
+config FAULT_AROUND
+	bool "Enable fault around"
+	default y
+	help
+	 This option enables fault around. If say N, fault_around_bytes set to PAGE_SIZE
+	 and disables fault around.
 endmenu
diff --git a/mm/memory.c b/mm/memory.c
index 10d2e4734e82..0bb037265dda 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3500,7 +3500,11 @@ vm_fault_t finish_fault(struct vm_fault *vmf)
 }
 
 static unsigned long fault_around_bytes __read_mostly =
+#ifdef CONFIG_FAULT_AROUND
 	rounddown_pow_of_two(65536);
+#else
+	PAGE_SIZE;
+#endif
 
 #ifdef CONFIG_DEBUG_FS
 static int fault_around_bytes_get(void *data, u64 *val)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ