Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5193843imb; Thu, 7 Mar 2019 09:44:09 -0800 (PST) X-Google-Smtp-Source: APXvYqw4mBNE1mftsN6fVcRQSme6g1F++lTxva47U2qMSOg3EPL4KTRUgtl5a8IR/fkvs+ENDfhZ X-Received: by 2002:a17:902:7d89:: with SMTP id a9mr13877201plm.33.1551980649882; Thu, 07 Mar 2019 09:44:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551980649; cv=none; d=google.com; s=arc-20160816; b=ftMsRZlA4maM8u3FtqooK3hWaVMaQ899sxNDrNgZOwB9gBHKGywA5pRx41MtBFxGSb EWryzfWS1MuFEXuU1nWhgAshXm/+sjsiR/7qJ4PFJUm7XJhMJ9kcuqvyKnubJqQIoW/x yC05zJNyVMp+lZ1rd+H3BGoLGyjHT4wEG8bk857PcOSdsJIxOKr7NBz3XBnZL9I8Osvz 20+uCZW7uS11MnFsro0qxMJXB6SIRIvatcQ/n5oYUaECKN8/3fmRdKi+Tn+XnfW4hay+ hqcE8iDE/pg2a5pYOzn6IUpiUuVw1lS6ghe9cYq6gp33qefyjZXt2GJhYx/BZMVrov1a E23g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=YLuY/M30AprAf93hrJrpkoO87w3hHezqqAwcTZjjLSU=; b=RK9dCOEx0xXf5SNFgDeXr4q6z+yaCiFpwOaFR+9z7rGL1d8cfkOoz1eIVYl5NC+mJY H6g9CxA+BRJTYo6n3xLLwlzS0/nsFfy4kv5Npcu7Po6qRsl1U7XU09fqk2QL8NmXeUKy jAYMGfyaBAVWb6Lbcpf8PqInDTd4Jplei+dvPBo2MDLNrkB0lqz2jmDy2KtOenKgPpH6 voblnW5SGx9ia51U93Vc4804YyplqCO4bhwe5l38JmPiLyNrxugybtLqSxWmj22jPHnA kSUCSF8GCEYuZJZk2Z30MG0ogaQgvzeaX6lZQs3J2jFs1TkNMMhrhWXiKbnHX2KhT2du ZGJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si4704907pll.105.2019.03.07.09.43.54; Thu, 07 Mar 2019 09:44:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726352AbfCGRnU (ORCPT + 99 others); Thu, 7 Mar 2019 12:43:20 -0500 Received: from smtprelay0001.hostedemail.com ([216.40.44.1]:59589 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726180AbfCGRnU (ORCPT ); Thu, 7 Mar 2019 12:43:20 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 01D92180A8437; Thu, 7 Mar 2019 17:43:19 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:2899:2902:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:4384:5007:10004:10400:10848:11026:11232:11658:11914:12043:12114:12438:12740:12760:12895:13069:13311:13357:13439:14096:14097:14181:14659:14721:21063:21080:21433:21451:21627:30012:30054:30090:30091,0,RBL:172.56.44.251:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:30,LUA_SUMMARY:none X-HE-Tag: feet26_564532aeeac24 X-Filterd-Recvd-Size: 2626 Received: from XPS-9350 (unknown [172.56.44.251]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Thu, 7 Mar 2019 17:43:12 +0000 (UTC) Message-ID: <1ad70fe88b2d22b2064c4ada53d3fb0bdacf6b66.camel@perches.com> Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' From: Joe Perches To: Russell King - ARM Linux admin Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Nick Desaulniers , Davidlohr Bueso , Elena Reshetova , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Date: Thu, 07 Mar 2019 09:42:40 -0800 In-Reply-To: <20190307172541.2262ccaxjk43twi4@shell.armlinux.org.uk> References: <20190307091514.2489338-1-arnd@arndb.de> <20190307172541.2262ccaxjk43twi4@shell.armlinux.org.uk> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-03-07 at 17:25 +0000, Russell King - ARM Linux admin wrote: > On Thu, Mar 07, 2019 at 09:19:04AM -0800, Joe Perches wrote: > > On Thu, 2019-03-07 at 10:14 +0100, Arnd Bergmann wrote: > > > On 32-bit ARM, I got a link failure in futex_init() when building > > > with clang in some random configurations: > > > > > > kernel/futex.o:(.text.fixup+0x5c): relocation truncated to fit: R_ARM_JUMP24 against `.init.text' > > > > > > As far as I can tell, the problem is that a branch is over 16MB > > > apart in those configurations, but only if it branches back to > > > the init text. > > > > > > Marking the futex_detect_cmpxchg() function as noinline and > > > not __init avoids the problem for me. > > > > Perhaps the __init and __exit #defines should be noinline > > to allow discarding of the code. > > How does that help this case? It doesn't particularly. It does help any other case that might arise. > It seems to me to be completely sane to have: > > static void __init foo(...) > { > } > > static int __init foo_init(...) > { > foo(); > } > > and have the expectation that the compiler _can_, if it desires, inline > foo() into foo_init(). True, but init function performance requirements are generally trivial and isolating the possibility of defects like this seems a reasonable trade-off to me.