• Lee Schermerhorn's avatar
    In preparation for constraining huge page allocation and freeing by the · 902c08ec
    Lee Schermerhorn authored
    controlling task's numa mempolicy, add a "nodes_allowed" nodemask pointer
    to the allocate, free and surplus adjustment functions.  For now, pass
    NULL to indicate default behavior--i.e., use node_online_map.  A
    subsqeuent patch will derive a non-default mask from the controlling
    task's numa mempolicy.
    
    Note that this method of updating the global hstate nr_hugepages under the
    constraint of a nodemask simplifies keeping the global state
    consistent--especially the number of persistent and surplus pages relative
    to reservations and overcommit limits.  There are undoubtedly other ways
    to do this, but this works for both interfaces: mempolicy and per node
    attributes.
    Signed-off-by: default avatarLee Schermerhorn <lee.schermerhorn@hp.com>
    Reviewed-by: default avatarMel Gorman <mel@csn.ul.ie>
    Acked-by: default avatarDavid Rientjes <rientjes@google.com>
    Reviewed-by: default avatarAndi Kleen <andi@firstfloor.org>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Randy Dunlap <randy.dunlap@oracle.com>
    Cc: Nishanth Aravamudan <nacc@us.ibm.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Adam Litke <agl@us.ibm.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Eric Whitney <eric.whitney@hp.com>
    Cc: Christoph Lameter <cl@linux-foundation.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    902c08ec
hugetlb.c 64.1 KB