Skip to content
  • Hugh Dickins's avatar
    ksm: trivial tidyups · e850dcf5
    Hugh Dickins authored
    
    
    Add NUMA() and DO_NUMA() macros to minimize blight of #ifdef
    CONFIG_NUMAs (but indeed we don't want to expand struct rmap_item by nid
    when not NUMA).  Add comment, remove "unsigned" from rmap_item->nid, as
    "int nid" elsewhere.  Define ksm_merge_across_nodes 1U when #ifndef NUMA
    to help optimizing out.  Use ?: in get_kpfn_nid().  Adjust a few
    comments noticed in ongoing work.
    
    Leave stable_tree_insert()'s rb_linkage until after the node has been
    set up, as unstable_tree_search_insert() does: ksm_thread_mutex and page
    lock make either way safe, but we're going to copy and I prefer this
    precedent.
    
    Signed-off-by: default avatarHugh Dickins <hughd@google.com>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Petr Holasek <pholasek@redhat.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Izik Eidus <izik.eidus@ravellosystems.com>
    Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
    Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e850dcf5