mm/hugetlb: get rid of NODEMASK_ALLOC

NODEMASK_ALLOC is used to allocate a nodemask bitmap, and it does it by
first determining whether it should be allocated on the stack or
dynamically, depending on NODES_SHIFT.  Right now, it goes the dynamic
path whenever the nodemask_t is above 32 bytes.

Although we could bump it to a reasonable value, the largest a nodemask_t
can get is 128 bytes, so since __nr_hugepages_store_common is called from
a rather short stack we can just get rid of the NODEMASK_ALLOC call here.

This reduces some code churn and complexity.

Signed-off-by: Oscar Salvador <>
Reviewed-by: Mike Kravetz <>
Reviewed-by: Naoya Horiguchi <>
Cc: Alex Ghiti <>
Cc: David Rientjes <>
Cc: Jing Xiangfeng <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed