]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/vmscan: make sure wakeup_kswapd with managed zone
authorWei Yang <richard.weiyang@gmail.com>
Thu, 14 Apr 2022 19:16:53 +0000 (12:16 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 14 Apr 2022 21:49:52 +0000 (17:49 -0400)
wakeup_kswapd() only wake up kswapd when the zone is managed.

For two callers of wakeup_kswapd(), they are node perspective.

  * wake_all_kswapds
  * numamigrate_isolate_page

If we picked up a !managed zone, this is not we expected.

This patch makes sure we pick up a managed zone for wakeup_kswapd().  And
it also use managed_zone in migrate_balanced_pgdat() to get the proper
zone.

Link: https://lkml.kernel.org/r/20220327024101.10378-2-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/migrate.c
mm/page_alloc.c

index 2f7194cc52ad7c8f9b34715b290fb1e5c0645f51..6598a07df18267df791e7b5f5c51dc5654fd0ca1 100644 (file)
@@ -2044,7 +2044,7 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
                if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING))
                        return 0;
                for (z = pgdat->nr_zones - 1; z >= 0; z--) {
-                       if (populated_zone(pgdat->node_zones + z))
+                       if (managed_zone(pgdat->node_zones + z))
                                break;
                }
                wakeup_kswapd(pgdat->node_zones + z, 0, order, ZONE_MOVABLE);
index 60d3009e914922fb234ee3ff7242bc4e928c2133..cbfc7a11aaa6700002069c21692520096b77dd47 100644 (file)
@@ -4630,6 +4630,8 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask,
 
        for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, highest_zoneidx,
                                        ac->nodemask) {
+               if (!managed_zone(zone))
+                       continue;
                if (last_pgdat != zone->zone_pgdat) {
                        wakeup_kswapd(zone, gfp_mask, order, highest_zoneidx);
                        last_pgdat = zone->zone_pgdat;