From: David Rientjes Date: Tue, 14 Apr 2015 22:46:52 +0000 (-0700) Subject: mm, mempolicy: migrate_to_node should only migrate to node X-Git-Tag: omap-for-v4.1/fixes-rc1~151^2~35 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b360edb43f8ed50aa7b8c9aae7d7557a1a6e32c8;p=pandora-kernel.git mm, mempolicy: migrate_to_node should only migrate to node 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 Reviewed-by: Naoya Horiguchi Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed