The Ultra Kernel Samepage Merging feature ---------------------------------------------- /* * Ultra KSM. Copyright (C) 2011-2012 Nai Xia * * This is an improvement upon KSM. Some basic data structures and routines * are borrowed from ksm.c . * * Its new features: * 1. Full system scan: * It automatically scans all user processes' anonymous VMAs. Kernel-user * interaction to submit a memory area to KSM is no longer needed. * * 2. Rich area detection: * It automatically detects rich areas containing abundant duplicated * pages based. Rich areas are given a full scan speed. Poor areas are * sampled at a reasonable speed with very low CPU consumption. * * 3. Ultra Per-page scan speed improvement: * A new hash algorithm is proposed. As a result, on a machine with * Core(TM)2 Quad Q9300 CPU in 32-bit mode and 800MHZ DDR2 main memory, it * can scan memory areas that does not contain duplicated pages at speed of * 627MB/sec ~ 2445MB/sec and can merge duplicated areas at speed of * 477MB/sec ~ 923MB/sec. * * 4. Thrashing area avoidance: * Thrashing area(an VMA that has frequent Ksm page break-out) can be * filtered out. My benchmark shows it's more efficient than KSM's per-page * hash value based volatile page detection. * * * 5. Misc changes upon KSM: * * It has a fully x86-opitmized memcmp dedicated for 4-byte-aligned page * comparison. It's much faster than default C version on x86. * * rmap_item now has an struct *page member to loosely cache a * address-->page mapping, which reduces too much time-costly * follow_page(). * * The VMA creation/exit procedures are hooked to let the Ultra KSM know. * * try_to_merge_two_pages() now can revert a pte if it fails. No break_ * ksm is needed for this case. * * 6. Full Zero Page consideration(contributed by Figo Zhang) * Now uksmd consider full zero pages as special pages and merge them to an * special unswappable uksm zero page. */ ChangeLog: 2012-05-05 The creation of this Doc 2012-05-08 UKSM 0.1.1.1 libc crash bug fix, api clean up, doc clean up. 2012-05-28 UKSM 0.1.1.2 bug fix release 2012-06-26 UKSM 0.1.2-beta1 first beta release for 0.1.2 2012-07-2 UKSM 0.1.2-beta2 2012-07-10 UKSM 0.1.2-beta3 2012-07-26 UKSM 0.1.2 Fine grained speed control, more scan optimization. 2012-10-13 UKSM 0.1.2.1 Bug fixes. 2012-12-31 UKSM 0.1.2.2 Minor bug fixes. 2014-07-02 UKSM 0.1.2.3 Fix a " __this_cpu_read() in preemptible bug". 2015-04-22 UKSM 0.1.2.4 Fix a race condition that can sometimes trigger anonying warnings. 2016-09-10 UKSM 0.1.2.5 Fix a bug in dedup ratio calculation.