Skip to content

Commit

Permalink
Revert "mm/page_isolation: unset migratetype directly for non Buddy p…
Browse files Browse the repository at this point in the history
…age"

This reverts commit 721fb89.

Commit 721fb89 ("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/[email protected]
Fixes: 721fb89 ("mm/page_isolation: unset migratetype directly for non Buddy page")
Signed-off-by: Chen Wandun <[email protected]>
Reported-by: "kernelci.org bot" <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Tested-by: Dong Aisheng <[email protected]>
Tested-by: Francesco Dolcini <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Chen Wandun authored and torvalds committed Feb 4, 2022
1 parent 1f2cfdd commit a85468b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/page_isolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a85468b

Please sign in to comment.