* [patch] mm, mempolicy: migrate_to_node should only migrate to node
@ 2015-02-24 23:18 David Rientjes
2015-02-27 6:13 ` Naoya Horiguchi
0 siblings, 1 reply; 2+ messages in thread
From: David Rientjes @ 2015-02-24 23:18 UTC (permalink / raw)
To: Andrew Morton; +Cc: Mel Gorman, Naoya Horiguchi, linux-kernel, linux-mm
migrate_to_node() is intended to migrate a page from one source node to a
target node.
Today, migrate_to_node() could end up migrating to any node, not only the
target node. This is because the page migration allocator,
new_node_page() does not pass __GFP_THISNODE to alloc_pages_exact_node().
This causes the target node to be preferred but allows fallback to any
other node in order of affinity.
Prevent this by allocating with __GFP_THISNODE. If memory is not
available, -ENOMEM will be returned as appropriate.
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
@@ -945,7 +945,8 @@ static struct page *new_node_page(struct page *page, unsigned long node, int **x
return alloc_huge_page_node(page_hstate(compound_head(page)),
node);
else
- return alloc_pages_exact_node(node, GFP_HIGHUSER_MOVABLE, 0);
+ return alloc_pages_exact_node(node, GFP_HIGHUSER_MOVABLE |
+ __GFP_THISNODE, 0);
}
/*
--
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] 2+ messages in thread
* Re: [patch] mm, mempolicy: migrate_to_node should only migrate to node
2015-02-24 23:18 [patch] mm, mempolicy: migrate_to_node should only migrate to node David Rientjes
@ 2015-02-27 6:13 ` Naoya Horiguchi
0 siblings, 0 replies; 2+ messages in thread
From: Naoya Horiguchi @ 2015-02-27 6:13 UTC (permalink / raw)
To: David Rientjes; +Cc: Andrew Morton, Mel Gorman, linux-kernel, linux-mm
On Tue, Feb 24, 2015 at 03:18:06PM -0800, David Rientjes wrote:
> migrate_to_node() is intended to migrate a page from one source node to a
> target node.
>
> Today, migrate_to_node() could end up migrating to any node, not only the
> target node. This is because the page migration allocator,
> new_node_page() does not pass __GFP_THISNODE to alloc_pages_exact_node().
> This causes the target node to be preferred but allows fallback to any
> other node in order of affinity.
>
> Prevent this by allocating with __GFP_THISNODE. If memory is not
> available, -ENOMEM will be returned as appropriate.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
Make sense to me.
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
--
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] 2+ messages in thread
end of thread, other threads:[~2015-02-27 6:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24 23:18 [patch] mm, mempolicy: migrate_to_node should only migrate to node David Rientjes
2015-02-27 6:13 ` Naoya Horiguchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox