mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
mm, thp: really limit transparent hugepage allocation to local node
Commit077fcf116c("mm/thp: allocate transparent hugepages on local node") restructured alloc_hugepage_vma() with the intent of only allocating transparent hugepages locally when there was not an effective interleave mempolicy. alloc_pages_exact_node() does not limit the allocation to the single node, however, but rather prefers it. This is because __GFP_THISNODE is not set which would cause the node-local nodemask to be passed. Without it, only a nodemask that prefers the local node is passed. Fix this by passing __GFP_THISNODE and falling back to small pages when the allocation fails. Commit9f1b868a13("mm: thp: khugepaged: add policy for finding target node") suffers from a similar problem for khugepaged, which is also fixed. Fixes:077fcf116c("mm/thp: allocate transparent hugepages on local node") Fixes:9f1b868a13("mm: thp: khugepaged: add policy for finding target node") Signed-off-by: David Rientjes <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Pravin Shelar <[email protected]> Cc: Jarno Rajahalme <[email protected]> Cc: Li Zefan <[email protected]> Cc: Greg Thelen <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4167e9b2cf
commit
5265047ac3
2 changed files with 9 additions and 3 deletions
|
|
@ -1986,7 +1986,8 @@ retry_cpuset:
|
|||
nmask = policy_nodemask(gfp, pol);
|
||||
if (!nmask || node_isset(node, *nmask)) {
|
||||
mpol_cond_put(pol);
|
||||
page = alloc_pages_exact_node(node, gfp, order);
|
||||
page = alloc_pages_exact_node(node,
|
||||
gfp | __GFP_THISNODE, order);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue