Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5181148imb; Thu, 7 Mar 2019 09:26:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxA/vF7hQBC2UNWj545QNXv18kW/tlNlf1aImIM4Arll4ob28Obfdl/Fmv6z5MdUo6Oach6 X-Received: by 2002:aa7:8117:: with SMTP id b23mr14183998pfi.2.1551979609863; Thu, 07 Mar 2019 09:26:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551979609; cv=none; d=google.com; s=arc-20160816; b=ZTeG6PSaNTfaJ3a4YWXmon9hrEzjY4L6phwpPGONrBNK8lCSTpg9Y9lHBPG8bhe+I0 afNEVUEycMYdsp/NhKVVVU41E4IprlhCAh1MPATgqP7E7nVEZJOdCP1Deq4fhmS9JLtR qyTWccmx0RF3VCYtsnkMyeHIgdTA6SM7wZadVY87ZppZYc2HKIqNinZYFPYKHRjZDGuK uYtLpquArBdhXXa33Wx1egySosG3XuWMj4WQDvNtZI8FzI8nLI/FeHPKCdcvx+8chig+ /B9CLVqkdlEGzzygiUKvZHXvsUlDtOaEuecijkMi9EIoCrGe1bJUqMqnYa0QfIvX8ltV R9zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zmZYJ14HC3xR/N0nbcdrUP79LPl6Auw13bU4hZ9Su0w=; b=iN54HKNdS1UX458GbBau50o7/dCoOBg0oJigq8qKekb8/zZE/sbgEdezAeyu35DTv4 Q8wJ/cuv8wlnCKCgc+w25u44CnKVCDaRpiNrm2kBY+lNaai6QSN6uuBKrdEBvJEruOjK 6gFnASqcO71CES/+5+yH9BRfnp/bsyv6k1aFrjHa01QQ4jnfrKNlT+EEri26NS6laLUI PupA8zLmjDfivw86Zq2pVjoDoaP5virJJem7l5Jn5tJyNrCBS6rPMA33lK2pbTsvnyj0 u7rWquH1l5OvPudqSdX/OyeBuL2Vbl8+Q0pr3ocWqWZY66RI1CbJxXzPsrbwpeS002aq RJQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=PkYNxo1Q; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si4665485pfh.6.2019.03.07.09.26.33; Thu, 07 Mar 2019 09:26:49 -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; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=PkYNxo1Q; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726409AbfCGR0I (ORCPT + 99 others); Thu, 7 Mar 2019 12:26:08 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:50890 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbfCGR0H (ORCPT ); Thu, 7 Mar 2019 12:26:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zmZYJ14HC3xR/N0nbcdrUP79LPl6Auw13bU4hZ9Su0w=; b=PkYNxo1QhA9NDN/9QuxfN/1/8 fLR7f10mKtBj7ETzuIdUlecNyqVzi8zghn2weogd5tsXk4EMrZAGB+BJa9Y9glZIsSr7hhr32f1k+ WlkKHdhteIfULj7bu5+UymR3EhgBSniOKjXDo9K1ESbRONeH7/UwZR0YQZad5zYc34LHkFQGk40VV MdnqOODEt68tfkm0/x7GzRHu/qgOSolkIqoXRweBe45O6zCLMgMVcXrdmG9LEXtm4wNiT6SUDjmzI 04IwolKBOIIAsREj2RpaltdPnk+X5atN1hF0V71rbY0+rkHOlEZjcb7GAP0/8GrOFEd4abr4h4BsU isz0fA7+A==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:54998) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1h1wmD-0007HG-Kb; Thu, 07 Mar 2019 17:25:49 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1h1wm6-00054f-3W; Thu, 07 Mar 2019 17:25:42 +0000 Date: Thu, 7 Mar 2019 17:25:41 +0000 From: Russell King - ARM Linux admin To: Joe Perches 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 Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Message-ID: <20190307172541.2262ccaxjk43twi4@shell.armlinux.org.uk> References: <20190307091514.2489338-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? The problem is futex_detect_cmpxchg() being placed in .init.text which is too far from .text.fixup. Whether it is inlined or not is immaterial since both futex_detect_cmpxchg() and its only caller futex_init() are both __init functions. 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(). Let me re-iterate: the inlining of futex_detect_cmpxchg() into futex_init() is not the issue here. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up