]> Git Repo - linux.git/commitdiff
mm/page_isolation: unset migratetype directly for non Buddy page
authorChen Wandun <[email protected]>
Fri, 14 Jan 2022 22:08:10 +0000 (14:08 -0800)
committerLinus Torvalds <[email protected]>
Sat, 15 Jan 2022 14:30:30 +0000 (16:30 +0200)
In unset_migratetype_isolate(), we can bypass the call to
move_freepages_block() for non-buddy pages.

It will save a few cpu cycles for some situations such as cma and
hugetlb when allocating continue pages, in these situation function
alloc_contig_pages will be called.

alloc_contig_pages
__alloc_contig_migrate_range
isolate_freepages_range ==> pages has been remove from buddy
undo_isolate_page_range
unset_migratetype_isolate ==> can directly set migratetype

[[email protected]: changelog tweak]

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 3c605096d315 ("mm/page_alloc: restrict max order of merging on isolated pageblock")
Signed-off-by: Chen Wandun <[email protected]>
Reviewed-by: Oscar Salvador <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Wang Kefeng <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_isolation.c

index f67c4c70f17f66c08626f57b1999462782395eff..6a0ddda6b3c53b4e5baf421ec9c8b2b215a7de90 100644 (file)
@@ -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) {
+       if (!isolated_page && PageBuddy(page)) {
                nr_pages = move_freepages_block(zone, page, migratetype, NULL);
                __mod_zone_freepage_state(zone, nr_pages, migratetype);
        }
This page took 0.061005 seconds and 4 git commands to generate.