Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Kernel Samepage Merging support (Linux)
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 27 Mar 2014 15:53:27 +0000 (16:53 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 28 Mar 2014 09:32:30 +0000 (10:32 +0100)
commit0d1dd360cb78fd7553037145656807a7e6d2274a
tree0f395aae3d0b0703083f8c593c51680109e950af
parent53fbfe2265a6aa2476b03648b68e9197db3d3722
[mc] Kernel Samepage Merging support (Linux)

Add MADV_MERGEABLE advice (madvise) for KSM in the heaps and
read/write segments: mark these regions of memory as candidate for
KSM. As the stacks are stored on the heap, they are candidate for KSM
as well.

In order to work, KSM must be enabled on the system (by root):

    # Enable:
    echo 1 > /sys/kernel/mm/ksm/run
    # Do some real work:
    echo 10000 > /sys/kernel/mm/ksm/pages_to_scan

See Documentation/vm/ksm.txt:

  https://www.kernel.org/doc/Documentation/vm/ksm.txt

We would like to only mark the .data+.bss and not the other sections
of the segment.
src/mc/mc_global.c
src/xbt/mmalloc/mmorecore.c