From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbcDOJI4 (ORCPT ); Fri, 15 Apr 2016 05:08:56 -0400 Received: from outbound-smtp03.blacknight.com ([81.17.249.16]:59574 "EHLO outbound-smtp03.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753787AbcDOJIx (ORCPT ); Fri, 15 Apr 2016 05:08:53 -0400 From: Mel Gorman To: Andrew Morton Cc: Vlastimil Babka , Jesper Dangaard Brouer , Linux-MM , LKML , Mel Gorman Subject: [PATCH 17/28] mm, page_alloc: Check once if a zone has isolated pageblocks Date: Fri, 15 Apr 2016 10:07:44 +0100 Message-Id: <1460711275-1130-5-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1460711275-1130-1-git-send-email-mgorman@techsingularity.net> References: <1460710760-32601-1-git-send-email-mgorman@techsingularity.net> <1460711275-1130-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Technically this is race-prone but so is the existing code. 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 4a364e318873..835a1c434832 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -831,6 +831,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, int batch_free = 0; int to_free = count; unsigned long nr_scanned; + bool isolated_pageblocks = has_isolate_pageblock(zone); spin_lock(&zone->lock); nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED); @@ -870,7 +871,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, /* MIGRATE_ISOLATE page should not go to pcplists */ VM_BUG_ON_PAGE(is_migrate_isolate(mt), page); /* Pageblock could have been isolated meanwhile */ - if (unlikely(has_isolate_pageblock(zone))) + if (unlikely(isolated_pageblocks)) mt = get_pageblock_migratetype(page); __free_one_page(page, page_to_pfn(page), zone, 0, mt); -- 2.6.4