From patchwork Fri Sep 21 10:46:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 185701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0059E2C007A for ; Fri, 21 Sep 2012 21:22:23 +1000 (EST) Received: from localhost ([::1]:57767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF0lU-0005Tz-25 for incoming@patchwork.ozlabs.org; Fri, 21 Sep 2012 06:47:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF0kl-0003UX-Up for qemu-devel@nongnu.org; Fri, 21 Sep 2012 06:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF0kh-0006sa-4V for qemu-devel@nongnu.org; Fri, 21 Sep 2012 06:46:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47266 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF0kg-0006sV-RI for qemu-devel@nongnu.org; Fri, 21 Sep 2012 06:46:31 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 51832A30B9; Fri, 21 Sep 2012 12:46:30 +0200 (CEST) From: Mel Gorman To: Andrew Morton Date: Fri, 21 Sep 2012 11:46:17 +0100 Message-Id: <1348224383-1499-4-git-send-email-mgorman@suse.de> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <1348224383-1499-1-git-send-email-mgorman@suse.de> References: <1348224383-1499-1-git-send-email-mgorman@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Richard Davies , KVM , QEMU-devel , LKML , Linux-MM , Avi Kivity , Shaohua Li , Mel Gorman Subject: [Qemu-devel] [PATCH 3/9] Revert "mm: compaction: abort compaction loop if lock is contended or run too long" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This reverts mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long.patch as it is replaced by a later patch in the series. Signed-off-by: Mel Gorman Acked-by: Rafael Aquini --- mm/compaction.c | 12 +++++------- mm/internal.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 1c873bb..614f18b 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -70,7 +70,8 @@ static bool compact_checklock_irqsave(spinlock_t *lock, unsigned long *flags, /* async aborts if taking too long or contended */ if (!cc->sync) { - cc->contended = true; + if (cc->contended) + *cc->contended = true; return false; } @@ -685,7 +686,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, /* Perform the isolation */ low_pfn = isolate_migratepages_range(zone, cc, low_pfn, end_pfn); - if (!low_pfn || cc->contended) + if (!low_pfn) return ISOLATE_ABORT; cc->migrate_pfn = low_pfn; @@ -893,7 +894,6 @@ static unsigned long compact_zone_order(struct zone *zone, bool sync, bool *contended, struct page **page) { - unsigned long ret; struct compact_control cc = { .nr_freepages = 0, .nr_migratepages = 0, @@ -901,15 +901,13 @@ static unsigned long compact_zone_order(struct zone *zone, .migratetype = allocflags_to_migratetype(gfp_mask), .zone = zone, .sync = sync, + .contended = contended, .page = page, }; INIT_LIST_HEAD(&cc.freepages); INIT_LIST_HEAD(&cc.migratepages); - ret = compact_zone(zone, &cc); - if (contended) - *contended = cc.contended; - return ret; + return compact_zone(zone, &cc); } int sysctl_extfrag_threshold = 500; diff --git a/mm/internal.h b/mm/internal.h index eebbed5..386772f 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -131,7 +131,7 @@ struct compact_control { int order; /* order a direct compactor needs */ int migratetype; /* MOVABLE, RECLAIMABLE etc */ struct zone *zone; - bool contended; /* True if a lock was contended */ + bool *contended; /* True if a lock was contended */ struct page **page; /* Page captured of requested size */ };