UKSM (Ultra Kernel Samepage Merging) - technology combining the same memory pages into one.
UKSM is inspired by KSM (technology from RedHat), but almost completely rewritten. KSM has several drawbacks:
Opacity for user and developer. The program should tell the kernel which pages to combine, rarely use it.
Rather stupid algorithm : scans memory at a constant speed. Why waste CPU if there are no pages that can be combined?
Slow enough : the maximum scanning speed that was achieved with the tests was 260 MB / s.
And here comes UKSM:
Scans the memory itself. Developers do not need to edit the source.
Do not waste CPU in vain. UKSM automatically detects non-aligned pages based on the history of random samples. The space with a large number of known non-aligned pages is given all the speed, while a space with a low number of pages combined is given low priority, practically without consuming processor cycles.
Very high speed. For this, a new hashing algorithm is used. Usually, to distinguish one page from another, it is enough to proheshirovat only part of it. At best, the algorithm only needs to prohesh only one 32-bit word, not the whole page, and at worst, its speed is comparable to SuperFastHash. The speed of searching pages: 627 - 2445 MB / s, and the speed of combining: 477 - 923 MB / s. Also, the CPU is not wasted in the zones of tracing, which gives significantly less CPU time instead of slightly worse memory savings.
What is the prize you can get? On my desktop, consumed memory was reduced by 50-100MB. Ideally, 10 identical virtual locks will consume the RAM as one. ')
Project site: kerneldedup.org/en