summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorChen Wandun <chenwandun@huawei.com>2022-04-29 14:36:59 -0700
committerakpm <akpm@linux-foundation.org>2022-04-29 14:36:59 -0700
commitd137a7cb9b2ab8155184b2da9a304afff8f84d36 (patch)
tree716f3ffba0c6812ec54ac533410815a254a23d1b /mm/page_alloc.c
parentec2a0f9c8b50865a11720651c9c536f20c578def (diff)
downloadlinux-d137a7cb9b2ab8155184b2da9a304afff8f84d36.tar.bz2
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 <chenwandun@huawei.com> Reviewed-by: Andrew 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: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e80858f5c2ab..f01c71e41bcf 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4631,9 +4631,10 @@ 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;
+ last_pgdat = zone->zone_pgdat;
+ }
}
}