提交 9a2591ba 编写于 作者: M Muchun Song 提交者: Zheng Zengkai

mm/page_isolation: do not isolate the max order page

mainline inclusion
from mainline-v5.11-rc1
commit 2484be0f
category: bugfix
bugzilla: 108337 https://gitee.com/openeuler/kernel/issues/I4DDEL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2484be0f88dc6c9670362d51f6a04f2da0626b50

-----------------------------------------------

A max order page has no buddy page and never merges to another order.  So
isolating and then freeing it is pointless.

Link: https://lkml.kernel.org/r/20201202122114.75316-1-songmuchun@bytedance.com
Fixes: 3c605096 ("mm/page_alloc: restrict max order of merging on isolated pageblock")
Signed-off-by: NMuchun Song <songmuchun@bytedance.com>
Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
Acked-by: NVlastimil Babka <vbabka@suse.cz>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
Reviewed-by: NOscar Salvador <osalvador@suse.de>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NTong Tiangen <tongtiangen@huawei.com>
Reviewed-by: NChen Wandun <chenwandun@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 846bc270
...@@ -89,7 +89,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) ...@@ -89,7 +89,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
*/ */
if (PageBuddy(page)) { if (PageBuddy(page)) {
order = buddy_order(page); order = buddy_order(page);
if (order >= pageblock_order) { if (order >= pageblock_order && order < MAX_ORDER - 1) {
pfn = page_to_pfn(page); pfn = page_to_pfn(page);
buddy_pfn = __find_buddy_pfn(pfn, order); buddy_pfn = __find_buddy_pfn(pfn, order);
buddy = page + (buddy_pfn - pfn); buddy = page + (buddy_pfn - pfn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册