From patchwork Mon Jun 2 14:33:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 4282711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D9679F1D6 for ; Mon, 2 Jun 2014 14:36:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C92CD20254 for ; Mon, 2 Jun 2014 14:36:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF8252024D for ; Mon, 2 Jun 2014 14:36:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WrTJW-0006JM-6a; Mon, 02 Jun 2014 14:34:14 +0000 Received: from cantor2.suse.de ([195.135.220.15] helo=mx2.suse.de) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WrTJS-0006DC-VO for linux-arm-kernel@lists.infradead.org; Mon, 02 Jun 2014 14:34:11 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 76523AD40; Mon, 2 Jun 2014 14:33:44 +0000 (UTC) Message-ID: <538C8B45.6070803@suse.cz> Date: Mon, 02 Jun 2014 16:33:41 +0200 From: Vlastimil Babka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Fabio Estevam , Andrew Morton Subject: [PATCH -mm] mm, compaction: properly signal and act upon lock and need_sched() contention - fix References: <1399904111-23520-1-git-send-email-vbabka@suse.cz> <1400233673-11477-1-git-send-email-vbabka@suse.cz> <537F082F.50501@suse.cz> In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140602_073411_167231_A10FD165 X-CRM114-Status: GOOD ( 14.78 ) X-Spam-Score: -5.0 (-----) Cc: Rik van Riel , Kevin Hilman , Bartlomiej Zolnierkiewicz , Stephen Warren , Hugh Dickins , LKML , Michal Nazarewicz , linux-mm@kvack.org, Minchan Kim , Mel Gorman , David Rientjes , Olof Johansson , Greg Thelen , Joonsoo Kim , Shawn Guo , Christoph Lameter , linux-arm-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP compact_should_abort() returns true instead of false and vice versa due to changes between v1 and v2 of the patch. This makes both async and sync compaction abort with high probability, and has been reported to cause e.g. soft lockups on some ARM boards, or drivers calling dma_alloc_coherent() fail to probe with CMA enabled on different boards. This patch fixes the return value to match comments and callers expecations. Reported-and-tested-by: Kevin Hilman Reported-and-tested-by: Shawn Guo Tested-by: Stephen Warren Signed-off-by: Vlastimil Babka Tested-by: Fabio Estevam Acked-by: David Rientjes --- mm/compaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.8.4.5 diff --git a/mm/compaction.c b/mm/compaction.c index a525cd4..5175019 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -237,13 +237,13 @@ static inline bool compact_should_abort(struct compact_control *cc) if (need_resched()) { if (cc->mode == MIGRATE_ASYNC) { cc->contended = true; - return false; + return true; } cond_resched(); } - return true; + return false; } /* Returns true if the page is within a block suitable for migration to */