提交 a85468b7 编写于 作者: C Chen Wandun 提交者: Linus Torvalds

Revert "mm/page_isolation: unset migratetype directly for non Buddy page"

This reverts commit 721fb891.

Commit 721fb891 ("mm/page_isolation: unset migratetype directly for
non Buddy page") will result memory that should in buddy disappear by
mistake.  move_freepages_block moves all pages in pageblock instead of
pages indicated by input parameter, so if input pages is not in buddy
but other pages in pageblock is in buddy, it will result in page out of
control.

Link: https://lkml.kernel.org/r/20220126024436.13921-1-chenwandun@huawei.com
Fixes: 721fb891 ("mm/page_isolation: unset migratetype directly for non Buddy page")
Signed-off-by: NChen Wandun <chenwandun@huawei.com>
Reported-by: N"kernelci.org bot" <bot@kernelci.org>
Acked-by: NDavid Hildenbrand <david@redhat.com>
Tested-by: NDong Aisheng <aisheng.dong@nxp.com>
Tested-by: NFrancesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: NVlastimil Babka <vbabka@suse.cz>
Tested-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1f2cfdd3
......@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
* onlining - just onlined memory won't immediately be considered for
* allocation.
*/
if (!isolated_page && PageBuddy(page)) {
if (!isolated_page) {
nr_pages = move_freepages_block(zone, page, migratetype, NULL);
__mod_zone_freepage_state(zone, nr_pages, migratetype);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册