Commit 3777999d authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds

mm, page_alloc: check once if a zone has isolated pageblocks

When bulk freeing pages from the per-cpu lists the zone is checked for
isolated pageblocks on every release.  This patch checks it once per
drain.

[mgorman@techsingularity.net: fix locking radce, per Vlastimil]
Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 83d4ca81
...@@ -831,8 +831,10 @@ static void free_pcppages_bulk(struct zone *zone, int count, ...@@ -831,8 +831,10 @@ static void free_pcppages_bulk(struct zone *zone, int count,
int batch_free = 0; int batch_free = 0;
int to_free = count; int to_free = count;
unsigned long nr_scanned; unsigned long nr_scanned;
bool isolated_pageblocks;
spin_lock(&zone->lock); spin_lock(&zone->lock);
isolated_pageblocks = has_isolate_pageblock(zone);
nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED); nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED);
if (nr_scanned) if (nr_scanned)
__mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned); __mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned);
...@@ -870,7 +872,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, ...@@ -870,7 +872,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,
/* MIGRATE_ISOLATE page should not go to pcplists */ /* MIGRATE_ISOLATE page should not go to pcplists */
VM_BUG_ON_PAGE(is_migrate_isolate(mt), page); VM_BUG_ON_PAGE(is_migrate_isolate(mt), page);
/* Pageblock could have been isolated meanwhile */ /* Pageblock could have been isolated meanwhile */
if (unlikely(has_isolate_pageblock(zone))) if (unlikely(isolated_pageblocks))
mt = get_pageblock_migratetype(page); mt = get_pageblock_migratetype(page);
__free_one_page(page, page_to_pfn(page), zone, 0, mt); __free_one_page(page, page_to_pfn(page), zone, 0, mt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment