ksm: allow dedup all tasks memory
RFC PATCH 1/1 ksm: allow dedup all tasks memory
ksm by default working only on memory that added by madvice().
And only way get that work on other applications:
- Use LD_PRELOAD and libraries
- Patch kernel
Lets use kernel task list in ksm_scan_thread and add logic to allow ksm import VMA from tasks.
That behaviour controlled by new attribute: mode
I try mimic hugepages attribute, so mode have two states:
- normal - old default behaviour
- always [new] - allow ksm to get tasks vma and try working on that.
To reduce CPU load & tasklist locking time,
ksm try import VMAs from one task per loop.
So add new attribute "mode"
Two passible values:
- normal [default] - ksm use only madvice
- always [new] - ksm will search vma over all processes memory and
add it to the dedup list
--- Documentation/vm/ksm.txt | 3 + mm/ksm.c | 139 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 121 insertions(+), 21 deletions(-)
Documentation/vm/ksm.txt +3 -0
@@ -84,6 +84,9 @@ run - set 0 to stop ksmd from running but keep merged pages, Default: 0 (must be changed to 1 to activate KSM, except if CONFIG_SYSFS is disabled) +mode - set always to allow ksm dedup whole memory + set normal to use only madvice [default] + use_zero_pages - specifies whether empty pages (i.e. allocated pages that only contain zeroes) should be treated specially. When set to 1, empty pages are merged with the kernel
mm/ksm.c +118 -21
185 lines not on this page · raw message
--
2.14.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>