summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@techsingularity.net>2016-05-19 20:13:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 22:12:14 -0400
commit3777999dd47ec00ec34a151b1d93c0a2b721e822 (patch)
tree1c64a296774ffc929bf71ab7aab9023379f406dd /mm/page_alloc.c
parent83d4ca8148fd9092715fd8ef75b30bbfd67fd2a9 (diff)
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: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 48afc1a42bbd..a3b7eb86f912 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -831,8 +831,10 @@ static void free_pcppages_bulk(struct zone *zone, int count,
831 int batch_free = 0; 831 int batch_free = 0;
832 int to_free = count; 832 int to_free = count;
833 unsigned long nr_scanned; 833 unsigned long nr_scanned;
834 bool isolated_pageblocks;
834 835
835 spin_lock(&zone->lock); 836 spin_lock(&zone->lock);
837 isolated_pageblocks = has_isolate_pageblock(zone);
836 nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED); 838 nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED);
837 if (nr_scanned) 839 if (nr_scanned)
838 __mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned); 840 __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 /* MIGRATE_ISOLATE page should not go to pcplists */ 872 /* MIGRATE_ISOLATE page should not go to pcplists */
871 VM_BUG_ON_PAGE(is_migrate_isolate(mt), page); 873 VM_BUG_ON_PAGE(is_migrate_isolate(mt), page);
872 /* Pageblock could have been isolated meanwhile */ 874 /* Pageblock could have been isolated meanwhile */
873 if (unlikely(has_isolate_pageblock(zone))) 875 if (unlikely(isolated_pageblocks))
874 mt = get_pageblock_migratetype(page); 876 mt = get_pageblock_migratetype(page);
875 877
876 __free_one_page(page, page_to_pfn(page), zone, 0, mt); 878 __free_one_page(page, page_to_pfn(page), zone, 0, mt);