Commit 4553616e authored by Mel Gorman's avatar Mel Gorman Committed by James Toy

Calculate the number of pageblocks within a range properly

Patch
page-allocator-change-migratetype-for-all-pageblocks-within-a-high-order-page-during-__rmqueue_fallback
is meant to change the pageblock ownership of each pageblock within a
given range. This is necessary when the buddy to be split is of higher
order than the pageblock_order. However, the calculation was wrong
leading to crashes on ia-64 and slightly incorrect behaviour on x86.
This patch corrects the calculation.
Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 2a2f2e68
......@@ -809,7 +809,7 @@ static int move_freepages_block(struct zone *zone, struct page *page,
static void change_pageblock_range(struct page *pageblock_page,
int start_order, int migratetype)
{
int nr_pageblocks = 1 << (MAX_ORDER - 1 - start_order);
int nr_pageblocks = 1 << (start_order - pageblock_order);
while (nr_pageblocks--) {
set_pageblock_migratetype(pageblock_page, migratetype);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment