Commit d137a7cb authored by Chen Wandun's avatar Chen Wandun Committed by Andrew Morton
Browse files

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: default avatarChen Wandun <chenwandun@huawei.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ec2a0f9c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4631,11 +4631,12 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask,
					ac->nodemask) {
		if (!managed_zone(zone))
			continue;
		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;
		}
	}
}

static inline unsigned int
gfp_to_alloc_flags(gfp_t gfp_mask)