]> git.baikalelectronics.ru Git - kernel.git/commit
mm/hotplug: remove unnecessary BUG_ON in __offline_pages()
authorXishi Qiu <qiuxishi@huawei.com>
Wed, 11 Sep 2013 21:21:41 +0000 (14:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Sep 2013 22:57:35 +0000 (15:57 -0700)
commit26b3b878b94c65a3ba9ee0e9392a50040022ba3c
tree8456554ec797adf9c03c56173c48c2082bcdb40e
parent8e41ece428e1af9dcd7b212e5f63b184edc8057a
mm/hotplug: remove unnecessary BUG_ON in __offline_pages()

I think we can remove "BUG_ON(start_pfn >= end_pfn)" in __offline_pages(),
because in memory_block_action() "nr_pages = PAGES_PER_SECTION * sections_per_block"
is always greater than 0.

memory_block_action()
offline_pages()
__offline_pages()
BUG_ON(start_pfn >= end_pfn)

In v2.6.32, If info->length==0, this way may hit this BUG_ON().
acpi_memory_disable_device()
remove_memory(info->start_addr, info->length)
offline_pages()

A later Fujitsu patch renamed this function and the BUG_ON() is
unnecessary.

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory_hotplug.c