Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1389191 > unrolled thread

[PATCH 3/6] mm, page_alloc: Check once if a zone has isolated pageblocks -fix

Started byMel Gorman <mgorman@techsingularity.net>
First post2016-04-27 17:00 +0200
Last post2016-04-27 17:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/6] mm, page_alloc: Check once if a zone has isolated pageblocks -fix Mel Gorman <mgorman@techsingularity.net> - 2016-04-27 17:00 +0200

#1389191 — [PATCH 3/6] mm, page_alloc: Check once if a zone has isolated pageblocks -fix

FromMel Gorman <mgorman@techsingularity.net>
Date2016-04-27 17:00 +0200
Subject[PATCH 3/6] mm, page_alloc: Check once if a zone has isolated pageblocks -fix
Message-ID<rsz6y-2T0-7@gated-at.bofh.it>
Vlastimil Babka pointed out that the original code was protected by
the zone lock and provided a fix.

This is a fix to the mmotm patch
mm-page_alloc-check-once-if-a-zone-has-isolated-pageblocks.patch . Once
applied the following line should be removed from the changelog "Technically
this is race-prone but so is the existing code."

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
 mm/page_alloc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9ad4e68486e9..c63e5e7e4864 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1098,9 +1098,10 @@ static void free_pcppages_bulk(struct zone *zone, int count,
 	int migratetype = 0;
 	int batch_free = 0;
 	unsigned long nr_scanned;
-	bool isolated_pageblocks = has_isolate_pageblock(zone);
+	bool isolated_pageblocks;
 
 	spin_lock(&zone->lock);
+	isolated_pageblocks = has_isolate_pageblock(zone);
 	nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED);
 	if (nr_scanned)
 		__mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned);
-- 
2.6.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web