diff options
author | Andrey Ryabinin <aryabinin@virtuozzo.com> | 2019-03-05 18:49:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 00:07:21 -0500 |
commit | 5f438eee8f2e972e910b558a1a243def508b6a35 (patch) | |
tree | 83d09a249ca37ad3dc550c5f72cf796b670f060d /mm/compaction.c | |
parent | f4b7e272b5c0425915e2115068e0a5a20a3a628e (diff) |
mm/compaction: pass pgdat to too_many_isolated() instead of zone
too_many_isolated() in mm/compaction.c looks only at node state, so it
makes more sense to change argument to pgdat instead of zone.
Link: http://lkml.kernel.org/r/20190228083329.31892-3-aryabinin@virtuozzo.com
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Rik van Riel <riel@surriel.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: William Kucharski <william.kucharski@oracle.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index e054276cf397..f171a83707ce 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -738,16 +738,16 @@ isolate_freepages_range(struct compact_control *cc, | |||
738 | } | 738 | } |
739 | 739 | ||
740 | /* Similar to reclaim, but different enough that they don't share logic */ | 740 | /* Similar to reclaim, but different enough that they don't share logic */ |
741 | static bool too_many_isolated(struct zone *zone) | 741 | static bool too_many_isolated(pg_data_t *pgdat) |
742 | { | 742 | { |
743 | unsigned long active, inactive, isolated; | 743 | unsigned long active, inactive, isolated; |
744 | 744 | ||
745 | inactive = node_page_state(zone->zone_pgdat, NR_INACTIVE_FILE) + | 745 | inactive = node_page_state(pgdat, NR_INACTIVE_FILE) + |
746 | node_page_state(zone->zone_pgdat, NR_INACTIVE_ANON); | 746 | node_page_state(pgdat, NR_INACTIVE_ANON); |
747 | active = node_page_state(zone->zone_pgdat, NR_ACTIVE_FILE) + | 747 | active = node_page_state(pgdat, NR_ACTIVE_FILE) + |
748 | node_page_state(zone->zone_pgdat, NR_ACTIVE_ANON); | 748 | node_page_state(pgdat, NR_ACTIVE_ANON); |
749 | isolated = node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE) + | 749 | isolated = node_page_state(pgdat, NR_ISOLATED_FILE) + |
750 | node_page_state(zone->zone_pgdat, NR_ISOLATED_ANON); | 750 | node_page_state(pgdat, NR_ISOLATED_ANON); |
751 | 751 | ||
752 | return isolated > (inactive + active) / 2; | 752 | return isolated > (inactive + active) / 2; |
753 | } | 753 | } |
@@ -774,8 +774,7 @@ static unsigned long | |||
774 | isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, | 774 | isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, |
775 | unsigned long end_pfn, isolate_mode_t isolate_mode) | 775 | unsigned long end_pfn, isolate_mode_t isolate_mode) |
776 | { | 776 | { |
777 | struct zone *zone = cc->zone; | 777 | pg_data_t *pgdat = cc->zone->zone_pgdat; |
778 | pg_data_t *pgdat = zone->zone_pgdat; | ||
779 | unsigned long nr_scanned = 0, nr_isolated = 0; | 778 | unsigned long nr_scanned = 0, nr_isolated = 0; |
780 | struct lruvec *lruvec; | 779 | struct lruvec *lruvec; |
781 | unsigned long flags = 0; | 780 | unsigned long flags = 0; |
@@ -791,7 +790,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, | |||
791 | * list by either parallel reclaimers or compaction. If there are, | 790 | * list by either parallel reclaimers or compaction. If there are, |
792 | * delay for some time until fewer pages are isolated | 791 | * delay for some time until fewer pages are isolated |
793 | */ | 792 | */ |
794 | while (unlikely(too_many_isolated(zone))) { | 793 | while (unlikely(too_many_isolated(pgdat))) { |
795 | /* async migration should just abort */ | 794 | /* async migration should just abort */ |
796 | if (cc->mode == MIGRATE_ASYNC) | 795 | if (cc->mode == MIGRATE_ASYNC) |
797 | return 0; | 796 | return 0; |