]> git.karo-electronics.de Git - karo-tx-linux.git/commit
memory hotplug: fix next block calculation in is_removable
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Thu, 9 Sep 2010 23:38:01 +0000 (16:38 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:36:39 +0000 (13:36 -0700)
commit1d1a528b65f9c4f9f5f1bb2341aef6e4f3bfc5d1
tree7f2fb08318c4245ea77e944e1c48fe812e8f32c6
parentac1a91ede75a5311e57b1a093d8b313cd7c9f515
memory hotplug: fix next block calculation in is_removable

commit 0dcc48c15f63ee86c2fcd33968b08d651f0360a5 upstream.

next_active_pageblock() is for finding next _used_ freeblock.  It skips
several blocks when it finds there are a chunk of free pages lager than
pageblock.  But it has 2 bugs.

  1. We have no lock. page_order(page) - pageblock_order can be minus.
  2. pageblocks_stride += is wrong. it should skip page_order(p) of pages.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
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/memory_hotplug.c