From patchwork Wed Apr 1 21:54:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 6142491 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1BACE9F350 for ; Wed, 1 Apr 2015 21:58:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45C6620306 for ; Wed, 1 Apr 2015 21:58:20 +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 3924A20165 for ; Wed, 1 Apr 2015 21:58:19 +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 1YdQbn-0000GQ-GU; Wed, 01 Apr 2015 21:55:35 +0000 Received: from mail-pd0-f175.google.com ([209.85.192.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YdQbe-0007YX-M9 for linux-arm-kernel@lists.infradead.org; Wed, 01 Apr 2015 21:55:27 +0000 Received: by pdea3 with SMTP id a3so16556600pde.3 for ; Wed, 01 Apr 2015 14:55:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=a/CXWYJjTQaxGYao0EctD4QbuxaQDu5H7G1KOcMtA50=; b=fgBa4xa3SBKExzx9Xy/tA0a5YuP68y6CYaywLQM0iSvM3kkdafdDVnGCk0QLKKOQJV rX0FwFFgNi4XwVdN5HsW03C6Ip4Fe9jQETDQfMGxyQcaiD3xwhFqLxKYRYVTjn9kRmpZ zFR5DdR4p2Qu2PnEOS0AmXPFifxmIEwnimCxYOBXhCjrt63fjy982Sgw+JC5jfgTnGZO leFhpqmxGZ90d1ag0rshaxCwWN3wsID0EmsDXbvlfy3eOYj72du/ZL/nNOv1HTkEsZQf IZNJ/sYMpAbOIqbbb8D8tDB5f1ry0K+xSeGnMRuiIdG0NnVqzpZ+kWgIjUD2lo1w+aC6 2NUQ== X-Gm-Message-State: ALoCoQkwBC27uGFgaYRjLC3M80UCTxmWXcLJmnjh5y5pYGfdzRH58wejmQbKSGfFR2RA5cVdcKsO X-Received: by 10.68.179.225 with SMTP id dj1mr21329993pbc.0.1427925302176; Wed, 01 Apr 2015 14:55:02 -0700 (PDT) Received: from localhost (c-67-160-101-93.hsd1.wa.comcast.net. [67.160.101.93]) by mx.google.com with ESMTPSA id br5sm2618517pbd.73.2015.04.01.14.55.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 14:55:01 -0700 (PDT) From: Kevin Hilman To: Andrew Morton Subject: Re: [PATCH] mm/migrate: Mark unmap_and_move() "noinline" to avoid ICE in gcc 4.7.3 References: <20150324004537.GA24816@verge.net.au> <20150324161358.GA694@kahuna> <20150326003939.GA25368@verge.net.au> <20150326133631.GB2805@arm.com> <20150327002554.GA5527@verge.net.au> <20150327100612.GB1562@arm.com> <7hbnj99epe.fsf@deeprootsystems.com> <7h8uec95t2.fsf@deeprootsystems.com> <551BBEC5.7070801@arm.com> <20150401124007.20c440cc43a482f698f461b8@linux-foundation.org> Date: Wed, 01 Apr 2015 14:54:59 -0700 In-Reply-To: <20150401124007.20c440cc43a482f698f461b8@linux-foundation.org> (Andrew Morton's message of "Wed, 1 Apr 2015 12:40:07 -0700") Message-ID: <7hwq1v4iq4.fsf@deeprootsystems.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150401_145526_807256_82FEC07A X-CRM114-Status: GOOD ( 17.48 ) X-Spam-Score: -0.7 (/) Cc: Nishanth Menon , Magnus Damm , Russell King - ARM Linux , Arnd Bergmann , Ard Biesheuvel , Marc Zyngier , Tyler Baker , "linux-sh@vger.kernel.org" , Will Deacon , Linux Kernel Development , "linux-mm@kvack.org" , Simon Horman , Geert Uytterhoeven , Catalin Marinas , "grygorii.strashko@linaro.org" , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Andrew Morton writes: > On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier wrote: > >> > -static int unmap_and_move(new_page_t get_new_page, free_page_t put_new_page, >> > - unsigned long private, struct page *page, int force, >> > - enum migrate_mode mode) >> > +static noinline int unmap_and_move(new_page_t get_new_page, >> > + free_page_t put_new_page, >> > + unsigned long private, struct page *page, >> > + int force, enum migrate_mode mode) >> > { >> > int rc = 0; >> > int *result = NULL; >> > >> >> Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of >> the parameters on the stack, which is not going to help performance >> either (not that this would be useful on 32bit ARM anyway...). >> >> Any chance you could make this dependent on some compiler detection >> mechanism? > > With my arm compiler (gcc-4.4.4) the patch makes no difference - > unmap_and_move() isn't being inlined anyway. > > How does this look? > > Kevin, could you please retest? I might have fat-fingered something... Your patch on top of Geert's still compiles fine for me with gcc-4.7.3. However, I'm not sure how specific we can be on the versions. /me goes to test a few more compilers... OK... ICE: 4.7.1, 4.7.3, 4.8.3 OK: 4.6.3, 4.9.2, 4.9.3 The diff below[2] on top of yours compiles fine here and at least covers the compilers I *know* to trigger the ICE. Kevin [1] diff --git a/mm/migrate.c b/mm/migrate.c index 25fd7f6291de..6e15ae3248e0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -901,10 +901,10 @@ out: } /* - * gcc-4.7.3 on arm gets an ICE when inlining unmap_and_move(). Work around + * gcc 4.7 and 4.8 on arm gets an ICE when inlining unmap_and_move(). Work around * it. */ -#if GCC_VERSION == 40703 && defined(CONFIG_ARM) +#if (GCC_VERSION >= 40700 && GCC_VERSION < 40900) && defined(CONFIG_ARM) #define ICE_noinline noinline #else #define ICE_noinline