Re: [PATCH 2/6] hugetlb: add nodemask arg to huge page alloc, free and surplus adjust fcns

David Rientjes
2009-09-03T18:39:39Z

On Fri, 28 Aug 2009, Lee Schermerhorn wrote:

> [PATCH 2/6] hugetlb: add nodemask arg to huge page alloc, free and surplus adjust fcns
>
> Against: 2.6.31-rc7-mmotm-090827-0057
>
> V3:
> + moved this patch to after the "rework" of hstate_next_node_to_...
> functions as this patch is more specific to using task mempolicy
> to control huge page allocation and freeing.
>
> V5:
> + removed now unneeded 'nextnid' from hstate_next_node_to_{alloc|free}
> and updated the stale comments.
>
> In preparation for constraining huge page allocation and freeing by the
> 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.
>
> Reviewed-by: Mel Gorman <mel@csn.ul.ie>
> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>

Still think the name `this_node_allowed()' is awkward, but I'm glad to see
hstate_next_node_to_{alloc,free} is clean.

Acked-by: David Rientjes <rientjes@google.com>