]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix usemap initialization
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tue, 29 Apr 2008 17:25:19 +0000 (17:25 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 May 2008 04:40:43 +0000 (21:40 -0700)
commit30e525eb19e64ded33f84529314f0dc82766553a
treec877b30e959a46606b8270650c676a8b201ace5f
parentf8f82be93ff5b04a494141f707066fc902bd6e54
mm: fix usemap initialization

commit: 86051ca5eaf5e560113ec7673462804c54284456 upstream

usemap must be initialized only when pfn is within zone.  If not, it corrupts
memory.

And this patch also reduces the number of calls to set_pageblock_migratetype()
from
(pfn & (pageblock_nr_pages -1)
to
!(pfn & (pageblock_nr_pages-1)
it should be called once per pageblock.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Shi Weihua <shiwh@cn.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/page_alloc.c