LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mm: make falutaround selectable
@ 2021-07-19 1:08 Chanho Min
2021-07-19 2:31 ` Matthew Wilcox
2021-07-20 12:11 ` David Hildenbrand
0 siblings, 2 replies; 3+ messages in thread
From: Chanho Min @ 2021-07-19 1:08 UTC (permalink / raw)
To: Andrew Morton, linux-mm
Cc: linux-kernel, Kirill A . Shutemov, Gunho Lee, Juneho Choi,
Inkyu Hwang, Chanho Min
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@lge.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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: make falutaround selectable
2021-07-19 1:08 [PATCH] mm: make falutaround selectable Chanho Min
@ 2021-07-19 2:31 ` Matthew Wilcox
2021-07-20 12:11 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2021-07-19 2:31 UTC (permalink / raw)
To: Chanho Min
Cc: Andrew Morton, linux-mm, linux-kernel, Kirill A . Shutemov,
Gunho Lee, Juneho Choi, Inkyu Hwang
On Mon, Jul 19, 2021 at 10:08:45AM +0900, Chanho Min wrote:
> 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.
It would be better if we could determine the circumstances under which
faultaround is causing problems and automatically disable it without
asking the sysadmin to determine that.
Can you tell us more about the workload?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: make falutaround selectable
2021-07-19 1:08 [PATCH] mm: make falutaround selectable Chanho Min
2021-07-19 2:31 ` Matthew Wilcox
@ 2021-07-20 12:11 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2021-07-20 12:11 UTC (permalink / raw)
To: Chanho Min, Andrew Morton, linux-mm
Cc: linux-kernel, Kirill A . Shutemov, Gunho Lee, Juneho Choi, Inkyu Hwang
s/falutaround/faultaround/
On 19.07.21 03:08, Chanho Min wrote:
> 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@lge.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)
>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-20 12:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 1:08 [PATCH] mm: make falutaround selectable Chanho Min
2021-07-19 2:31 ` Matthew Wilcox
2021-07-20 12:11 ` David Hildenbrand
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).