diff options
author | Baolin Wang <baolin.wang@linux.alibaba.com> | 2023-01-10 21:36:22 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-02 22:32:54 -0800 |
commit | 9e5522715e6941bcfdc08d066a79d6da0f8cec8e (patch) | |
tree | 54b4f513befc794a7028235c65863ad4f189d9c5 /mm/compaction.c | |
parent | 8fff8b6f8d0ef7620e06f3f4cfb912171aef6cd5 (diff) |
mm: compaction: avoid fragmentation score calculation for empty zones
There is no need to calculate the fragmentation score for empty zones.
Link: https://lkml.kernel.org/r/100331ad9d274a9725e687b00d85d75d7e4a17c7.1673342761.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 0fd6c81a7809..b758b00a4885 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2025,6 +2025,8 @@ static unsigned int fragmentation_score_node(pg_data_t *pgdat) struct zone *zone; zone = &pgdat->node_zones[zoneid]; + if (!populated_zone(zone)) + continue; score += fragmentation_score_zone_weighted(zone); } |