]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix off-by-two in __zone_watermark_ok()
authorMichal Hocko <mhocko@suse.cz>
Tue, 10 Jan 2012 23:08:02 +0000 (15:08 -0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:46 +0000 (08:35 +0200)
commit107722f89af30cfc6be6133dbf875c447653fe8f
tree24fc4837012c40ec626dee0a5e5632d0c8b63e40
parent45999c3851ea8d386db8194a748ccae38740d230
mm: fix off-by-two in __zone_watermark_ok()

Commit 88f5acf88ae6 ("mm: page allocator: adjust the per-cpu counter
threshold when memory is low") changed the form how free_pages is
calculated but it forgot that we used to do free_pages - ((1 << order) -
1) so we ended up with off-by-two when calculating free_pages.

Reported-by: Wang Sheng-Hui <shhuiw@gmail.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_alloc.c