summaryrefslogtreecommitdiffstats
path: root/mm/page_isolation.c
diff options
context:
space:
mode:
authorMinchan Kim2012-08-01 01:43:53 +0200
committerLinus Torvalds2012-08-01 03:42:45 +0200
commit2cfed0752808625d30aca7fc9f383af386fd8a13 (patch)
tree5e92da86e42e55b253cc04e10545e05b6b472542 /mm/page_isolation.c
parentmm: factor out memory isolate functions (diff)
downloadkernel-qcow2-linux-2cfed0752808625d30aca7fc9f383af386fd8a13.tar.gz
kernel-qcow2-linux-2cfed0752808625d30aca7fc9f383af386fd8a13.tar.xz
kernel-qcow2-linux-2cfed0752808625d30aca7fc9f383af386fd8a13.zip
mm: fix free page check in zone_watermark_ok()
__zone_watermark_ok currently compares free_pages which is a signed type with z->lowmem_reserve[classzone_idx] which is unsigned which might lead to sign overflow if free_pages doesn't satisfy the given order (or it came as negative already) and then we rely on the following order loop to fix it (which doesn't work for order-0). Let's fix the type conversion and do not rely on the given value of free_pages or follow up fixups. This patch fixes it because "memory-hotplug: fix kswapd looping forever problem" depends on this. As benefit of this patch, it doesn't rely on the loop to exit __zone_watermark_ok in case of high order check and make the first test effective.(ie, if (free_pages <= min + lowmem_reserve)) Aaditya reported this problem when he test my hotplug patch. Reported-off-by: Aaditya Kumar <aaditya.kumar@ap.sony.com> Tested-by: Aaditya Kumar <aaditya.kumar@ap.sony.com> Signed-off-by: Aaditya Kumar <aaditya.kumar@ap.sony.com> Signed-off-by: Minchan Kim <minchan@kernel.org> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Mel Gorman <mgorman@suse.de> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_isolation.c')
0 files changed, 0 insertions, 0 deletions