|
@@ -1258,7 +1258,8 @@ static bool is_pageblock_removable_nolock(struct page *page)
|
|
|
bool is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)
|
|
bool is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)
|
|
|
{
|
|
{
|
|
|
struct page *page = pfn_to_page(start_pfn);
|
|
struct page *page = pfn_to_page(start_pfn);
|
|
|
- struct page *end_page = page + nr_pages;
|
|
|
|
|
|
|
+ unsigned long end_pfn = min(start_pfn + nr_pages, zone_end_pfn(page_zone(page)));
|
|
|
|
|
+ struct page *end_page = pfn_to_page(end_pfn);
|
|
|
|
|
|
|
|
/* Check the starting page of each pageblock within the range */
|
|
/* Check the starting page of each pageblock within the range */
|
|
|
for (; page < end_page; page = next_active_pageblock(page)) {
|
|
for (; page < end_page; page = next_active_pageblock(page)) {
|