]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/page_isolation.c
x86/speculation/mds: Add mitigation control for MDS
[mirror_ubuntu-bionic-kernel.git] / mm / page_isolation.c
index 44f213935bf68722eb85271520faa6b7581ed3c6..165ed8117bd1da371e58f00094017ec2ebcfc790 100644 (file)
@@ -15,7 +15,7 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/page_isolation.h>
 
-static int set_migratetype_isolate(struct page *page,
+static int set_migratetype_isolate(struct page *page, int migratetype,
                                bool skip_hwpoisoned_pages)
 {
        struct zone *zone;
@@ -52,7 +52,7 @@ static int set_migratetype_isolate(struct page *page,
         * FIXME: Now, memory hotplug doesn't call shrink_slab() by itself.
         * We just check MOVABLE pages.
         */
-       if (!has_unmovable_pages(zone, page, arg.pages_found,
+       if (!has_unmovable_pages(zone, page, arg.pages_found, migratetype,
                                 skip_hwpoisoned_pages))
                ret = 0;
 
@@ -64,14 +64,14 @@ static int set_migratetype_isolate(struct page *page,
 out:
        if (!ret) {
                unsigned long nr_pages;
-               int migratetype = get_pageblock_migratetype(page);
+               int mt = get_pageblock_migratetype(page);
 
                set_pageblock_migratetype(page, MIGRATE_ISOLATE);
                zone->nr_isolate_pageblock++;
                nr_pages = move_freepages_block(zone, page, MIGRATE_ISOLATE,
                                                                        NULL);
 
-               __mod_zone_freepage_state(zone, -nr_pages, migratetype);
+               __mod_zone_freepage_state(zone, -nr_pages, mt);
        }
 
        spin_unlock_irqrestore(&zone->lock, flags);
@@ -183,7 +183,7 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
             pfn += pageblock_nr_pages) {
                page = __first_valid_page(pfn, pageblock_nr_pages);
                if (page &&
-                   set_migratetype_isolate(page, skip_hwpoisoned_pages)) {
+                   set_migratetype_isolate(page, migratetype, skip_hwpoisoned_pages)) {
                        undo_pfn = pfn;
                        goto undo;
                }