linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: x86_64_defconfig: Enable KSM.
@ 2018-06-14 22:50 Daniel Díaz
  2018-06-14 22:50 ` [PATCH 2/2] arm: multi_v7_defconfig: " Daniel Díaz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Daniel Díaz @ 2018-06-14 22:50 UTC (permalink / raw)
  To: x86
  Cc: anders.roxell, Daniel Díaz, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Josh Poimboeuf, Krzysztof Kozlowski,
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)

As per the documentation, Kernel Samepage Merging (available
since 2.6.32) is a memory-saving de-duplication feature,
enabled by CONFIG_KSM=y and activated via sysfs. More
information can be found here:
  https://www.kernel.org/doc/Documentation/vm/ksm.txt

When enabled in the kernel, the default is to not do anything
at all, until it is activated at run-time with:
  echo 1 > /sys/kernel/mm/ksm/run

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
---
 arch/x86/configs/x86_64_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index e32fc1f..8fd7396 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -48,6 +48,7 @@ CONFIG_MICROCODE_AMD=y
 CONFIG_X86_MSR=y
 CONFIG_X86_CPUID=y
 CONFIG_NUMA=y
+CONFIG_KSM=y
 CONFIG_X86_CHECK_BIOS_CORRUPTION=y
 # CONFIG_MTRR_SANITIZER is not set
 CONFIG_EFI=y
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] arm: multi_v7_defconfig: Enable KSM.
  2018-06-14 22:50 [PATCH 1/2] x86: x86_64_defconfig: Enable KSM Daniel Díaz
@ 2018-06-14 22:50 ` Daniel Díaz
  2018-06-15  6:09   ` Geert Uytterhoeven
  2018-06-15  8:27 ` [PATCH 1/2] x86: x86_64_defconfig: " Thomas Gleixner
  2018-06-15 12:23 ` Austin S. Hemmelgarn
  2 siblings, 1 reply; 5+ messages in thread
From: Daniel Díaz @ 2018-06-14 22:50 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: anders.roxell, Daniel Díaz, Russell King, Arnd Bergmann,
	Simon Horman, Stefan Agner, Tony Lindgren, Eric Anholt,
	Geert Uytterhoeven, Martin Blumenstingl, Marek Szyprowski,
	Kishon Vijay Abraham I, Krzysztof Kozlowski, Maxime Ripard,
	Marc Zyngier, open list

As per the documentation, Kernel Samepage Merging (available
since 2.6.32) is a memory-saving de-duplication feature,
enabled by CONFIG_KSM=y and activated via sysfs. More
information can be found here:
  https://www.kernel.org/doc/Documentation/vm/ksm.txt

When enabled in the kernel, the default is to not do anything
at all, until it is activated at run-time with:
  echo 1 > /sys/kernel/mm/ksm/run

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 7e1c543..79eedf4d 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -133,6 +133,7 @@ CONFIG_SMP=y
 CONFIG_NR_CPUS=16
 CONFIG_HIGHPTE=y
 CONFIG_CMA=y
+CONFIG_KSM=y
 CONFIG_SECCOMP=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] arm: multi_v7_defconfig: Enable KSM.
  2018-06-14 22:50 ` [PATCH 2/2] arm: multi_v7_defconfig: " Daniel Díaz
@ 2018-06-15  6:09   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-06-15  6:09 UTC (permalink / raw)
  To: daniel.diaz
  Cc: Linux ARM, anders.roxell, Russell King, Arnd Bergmann,
	Simon Horman, Stefan Agner, ext Tony Lindgren, Eric Anholt,
	Geert Uytterhoeven, martin.blumenstingl, Marek Szyprowski,
	Kishon Vijay Abraham I, Krzysztof Kozlowski, Maxime Ripard,
	Marc Zyngier, Linux Kernel Mailing List

Hi Daniel,

Thanks for your patch!

On Fri, Jun 15, 2018 at 12:52 AM Daniel Díaz <daniel.diaz@linaro.org> wrote:
> As per the documentation, Kernel Samepage Merging (available
> since 2.6.32) is a memory-saving de-duplication feature,
> enabled by CONFIG_KSM=y and activated via sysfs. More
> information can be found here:
>   https://www.kernel.org/doc/Documentation/vm/ksm.txt
>
> When enabled in the kernel, the default is to not do anything
> at all, until it is activated at run-time with:
>   echo 1 > /sys/kernel/mm/ksm/run

So that's the "what" part.

Why is it good to have this in multi_v7_defconfig, which is meant to ease
(compile)testing for as many supported ARM v7 SoCs as possible?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] x86: x86_64_defconfig: Enable KSM.
  2018-06-14 22:50 [PATCH 1/2] x86: x86_64_defconfig: Enable KSM Daniel Díaz
  2018-06-14 22:50 ` [PATCH 2/2] arm: multi_v7_defconfig: " Daniel Díaz
@ 2018-06-15  8:27 ` Thomas Gleixner
  2018-06-15 12:23 ` Austin S. Hemmelgarn
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2018-06-15  8:27 UTC (permalink / raw)
  To: Daniel Díaz
  Cc: x86, anders.roxell, Ingo Molnar, H. Peter Anvin, Josh Poimboeuf,
	Krzysztof Kozlowski,
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

On Thu, 14 Jun 2018, Daniel Díaz wrote:

> As per the documentation, Kernel Samepage Merging (available
> since 2.6.32) is a memory-saving de-duplication feature,
> enabled by CONFIG_KSM=y and activated via sysfs. More
> information can be found here:
>   https://www.kernel.org/doc/Documentation/vm/ksm.txt
> 
> When enabled in the kernel, the default is to not do anything
> at all, until it is activated at run-time with:
>   echo 1 > /sys/kernel/mm/ksm/run

We all know that, but the above does not make an argument WHY this needs to
be enabled in defconfig.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] x86: x86_64_defconfig: Enable KSM.
  2018-06-14 22:50 [PATCH 1/2] x86: x86_64_defconfig: Enable KSM Daniel Díaz
  2018-06-14 22:50 ` [PATCH 2/2] arm: multi_v7_defconfig: " Daniel Díaz
  2018-06-15  8:27 ` [PATCH 1/2] x86: x86_64_defconfig: " Thomas Gleixner
@ 2018-06-15 12:23 ` Austin S. Hemmelgarn
  2 siblings, 0 replies; 5+ messages in thread
From: Austin S. Hemmelgarn @ 2018-06-15 12:23 UTC (permalink / raw)
  To: Daniel Díaz, x86
  Cc: anders.roxell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Josh Poimboeuf, Krzysztof Kozlowski,
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)

On 2018-06-14 18:50, Daniel Díaz wrote:
> As per the documentation, Kernel Samepage Merging (available
> since 2.6.32) is a memory-saving de-duplication feature,
> enabled by CONFIG_KSM=y and activated via sysfs. More
> information can be found here:
>    https://www.kernel.org/doc/Documentation/vm/ksm.txt
> 
> When enabled in the kernel, the default is to not do anything
> at all, until it is activated at run-time with:
>    echo 1 > /sys/kernel/mm/ksm/run
> 
As pointed out by a couple of others, this doesn't explain why this is a 
good idea.  All you're doing here is giving a reason that it won't have 
a negative impact on most users.

Two points that may be worth adding, but also don't really argue for it 
being a significant improvement:

* Pretty much all of the major distributions that use pre-built kernels 
have it enabled in their kernels (At minimum, Debian, Ubuntu, Fedora 
(and by extension RHEL and CentOS), openSUSE (and by extension SLES), 
Arch, and Alpine have it enabled), so enabling this in defconfig would 
bring it a bit closer to parity with distribution kernels in terms of 
core features.

* Software other than QEMU is starting to take advantage of it if 
available (for example, Netdata [1] can mark it's in-memory TSDB's for 
deduplication, which usually cuts it's memory usage roughly in half).


[1] https://my-netdata.io/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-15 12:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 22:50 [PATCH 1/2] x86: x86_64_defconfig: Enable KSM Daniel Díaz
2018-06-14 22:50 ` [PATCH 2/2] arm: multi_v7_defconfig: " Daniel Díaz
2018-06-15  6:09   ` Geert Uytterhoeven
2018-06-15  8:27 ` [PATCH 1/2] x86: x86_64_defconfig: " Thomas Gleixner
2018-06-15 12:23 ` Austin S. Hemmelgarn

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).