Commit 0dfca313 authored by Kemeng Shi's avatar Kemeng Shi Committed by Andrew Morton

mm/page_alloc: remove unnecessary next_page in break_down_buddy_pages

The next_page is only used to forward page in case target is in second
half range.  Move forward page directly to remove unnecessary next_page.

Link: https://lkml.kernel.org/r/20230927103514.98281-3-shikemeng@huaweicloud.comSigned-off-by: default avatarKemeng Shi <shikemeng@huaweicloud.com>
Acked-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 27e0db3c
......@@ -6462,20 +6462,18 @@ static void break_down_buddy_pages(struct zone *zone, struct page *page,
int migratetype)
{
unsigned long size = 1 << high;
struct page *current_buddy, *next_page;
struct page *current_buddy;
while (high > low) {
high--;
size >>= 1;
if (target >= &page[size]) {
next_page = page + size;
current_buddy = page;
page = page + size;
} else {
next_page = page;
current_buddy = page + size;
}
page = next_page;
if (set_page_guard(zone, current_buddy, high, migratetype))
continue;
......
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