mempolicy: fix is_valid_nodemask()
authorLai Jiangshan <[email protected]>
Sat, 23 Feb 2013 00:33:22 +0000 (16:33 -0800)
committerLinus Torvalds <[email protected]>
Sun, 24 Feb 2013 01:50:13 +0000 (17:50 -0800)
commitd3eb1570a9221b1b3ea8f6f460a9674c1bb761f1
tree35792d7c35ba7012ea8d43bf5243e04a6b90323f
parent8a356ce38e134b3b09b439e88dc770f8f5567648
mempolicy: fix is_valid_nodemask()

is_valid_nodemask() was introduced by commit 19770b32609b ("mm: filter
based on a nodemask as well as a gfp_mask").  but it does not match its
comments, because it does not check the zone which > policy_zone.

Also in commit b377fd3982ad ("Apply memory policies to top two highest
zones when highest zone is ZONE_MOVABLE"), this commits told us, if
highest zone is ZONE_MOVABLE, we should also apply memory policies to
it.  so ZONE_MOVABLE should be valid zone for policies.
is_valid_nodemask() need to be changed to match it.

Fix: check all zones, even its zoneid > policy_zone.  Use
nodes_intersects() instead open code to check it.

Reported-by: Wen Congyang <[email protected]>
Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tang Chen <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Lee Schermerhorn <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Jianguo Wu <[email protected]>
Cc: Kamezawa Hiroyuki <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Yasuaki Ishimatsu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mempolicy.c