linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch for-4.0] mm, thp: really limit transparent hugepage allocation to local node
@ 2015-02-24 22:24 David Rientjes
  2015-02-24 23:24 ` [patch v2 " David Rientjes
  0 siblings, 1 reply; 8+ messages in thread
From: David Rientjes @ 2015-02-24 22:24 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Greg Thelen, Vlastimil Babka, Aneesh Kumar K.V, Linus Torvalds,
	linux-kernel, linux-mm

From: Greg Thelen <gthelen@google.com>

Commit 077fcf116c8c ("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.

Fixes: 077fcf116c8c ("mm/thp: allocate transparent hugepages on local node")
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/mempolicy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1985,7 +1985,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;
 		}
 	}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-05 13:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24 22:24 [patch for-4.0] mm, thp: really limit transparent hugepage allocation to local node David Rientjes
2015-02-24 23:24 ` [patch v2 " David Rientjes
2015-02-25 10:52   ` Vlastimil Babka
2015-02-25 21:24     ` David Rientjes
2015-02-25 23:55       ` Vlastimil Babka
2015-04-21  7:31         ` Aneesh Kumar K.V
2015-05-05  9:12           ` Vlastimil Babka
2015-05-05 13:22             ` Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox