From: Chen Wandun Date: Thu, 14 Apr 2022 06:07:09 +0000 (-0700) Subject: mm/page_alloc: simplify update of pgdat in wake_all_kswapds X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b24ea048b4c290959996309b62041e9f33569afd;p=users%2Fjedix%2Flinux-maple.git mm/page_alloc: simplify update of pgdat in wake_all_kswapds There is no need to update last_pgdat for each zone, only update last_pgdat when iterating the first zone of a node. Link: https://lkml.kernel.org/r/20220322115635.2708989-1-chenwandun@huawei.com Signed-off-by: Chen Wandun Cc: Mel Gorman Cc: Vlastimil Babka Cc: Johannes Weiner Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6b55fe38d646..1b92795ae5e2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4678,9 +4678,10 @@ 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 (last_pgdat != zone->zone_pgdat) + if (last_pgdat != zone->zone_pgdat) { wakeup_kswapd(zone, gfp_mask, order, highest_zoneidx); - last_pgdat = zone->zone_pgdat; + last_pgdat = zone->zone_pgdat; + } } }