Commit a85468b7 authored by Chen Wandun's avatar Chen Wandun Committed by 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: default avatarChen Wandun <chenwandun@huawei.com>
Reported-by: default avatar"kernelci.org bot" <bot@kernelci.org>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Tested-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Tested-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment