• Hugh Dickins's avatar
    ksm: define MADV_MERGEABLE and MADV_UNMERGEABLE · d19f3524
    Hugh Dickins authored
    The out-of-tree KSM used ioctls on fds cloned from /dev/ksm to register a
    memory area for merging: we prefer now to use an madvise(2) interface.
    
    This patch just defines MADV_MERGEABLE (to tell KSM it may merge pages in
    this area found identical to pages in other mergeable areas) and
    MADV_UNMERGEABLE (to undo that).
    
    Most architectures use asm-generic, but alpha, mips, parisc, xtensa need
    their own definitions: included here for mmotm convenience, but we'll
    probably want to split this and feed pieces to arch maintainers.
    
    Based upon earlier patches by Chris Wright and Izik Eidus.
    Signed-off-by: default avatarHugh Dickins <hugh.dickins@tiscali.co.uk>
    Signed-off-by: default avatarChris Wright <chrisw@redhat.com>
    Signed-off-by: default avatarIzik Eidus <ieidus@redhat.com>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Richard Henderson <rth@twiddle.net>
    Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: Kyle McMartin <kyle@mcmartin.ca>
    Cc: Helge Deller <deller@gmx.de>
    Cc: Chris Zankel <chris@zankel.net>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Wu Fengguang <fengguang.wu@intel.com>
    Cc: Balbir Singh <balbir@in.ibm.com>
    Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
    Cc: Avi Kivity <avi@redhat.com>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d19f3524
mman.h 3.17 KB