Skip to content

RFC ksm allow dedup all process memory

Timofey Titovets linux-mm 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1ksm: allow dedup all tasks memoryDocumentation/vm/ksm.txt mm/ksm.c+121 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/1] ksm allow dedup all process memory

Hi, about 3 years ago i firstly write to linux-mm,
when i acking about UKSM and make some ugly patches (like that [1]).

It's difficult to find conversation (for me at least, i only find
my patches).
So IIRC:
- I trying add support KSM to all process memory
for that i patch several memory places to call hooks like madvise. MM folks not like that and at now i'm not only agree, i can fix that another way.

First i try look at hugepagesd, but hugepages have a much different usecase. As example it's bad idea add ksm hook to page_fault.

So:
I 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 one VMA per loop.

Patch mirror: https://github.com/Nefelim4ag/linux/commit/be6a94e171bf214a26f8186bb76b1d365ccb3b08

Thanks, any comments are appricated!

(Yes i can split patch, but it's RFC and it's too small)

1. https://lkml.org/lkml/2014/11/8/208

Timofey Titovets (1):
ksm: allow dedup all tasks memory

 Documentation/vm/ksm.txt |   3 +
 mm/ksm.c                 | 139 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 121 insertions(+), 21 deletions(-)

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