From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbcD0O6L (ORCPT ); Wed, 27 Apr 2016 10:58:11 -0400 Received: from outbound-smtp02.blacknight.com ([81.17.249.8]:54152 "EHLO outbound-smtp02.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbcD0O52 (ORCPT ); Wed, 27 Apr 2016 10:57:28 -0400 From: Mel Gorman To: Andrew Morton Cc: Vlastimil Babka , Jesper Dangaard Brouer , Linux-MM , LKML , Mel Gorman Subject: [PATCH 3/6] mm, page_alloc: Check once if a zone has isolated pageblocks -fix Date: Wed, 27 Apr 2016 15:57:20 +0100 Message-Id: <1461769043-28337-4-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1461769043-28337-1-git-send-email-mgorman@techsingularity.net> References: <1461769043-28337-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Mel Gorman --- 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