mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Joe Perches <joe@perches.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Darren Hart <dvhart@infradead.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Elena Reshetova <elena.reshetova@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'
Date: Thu, 7 Mar 2019 18:07:56 +0000	[thread overview]
Message-ID: <20190307180756.z2omra6hhwobhwcc@shell.armlinux.org.uk> (raw)
In-Reply-To: <1ad70fe88b2d22b2064c4ada53d3fb0bdacf6b66.camel@perches.com>

On Thu, Mar 07, 2019 at 09:42:40AM -0800, Joe Perches wrote:
> 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.

Please describe what "any other case" you are thinking of - as already
stated, your patch would have no beneficial effect for the observed
issue.

In fact, it _could_ do exactly the opposite.  Where functions can be
inlined, they may become smaller due to no need for function prologue
and epilogue, and other optimisations.  Forcing the compiler to avoid
inlining them could result in larger code, which means a higher chance
of triggering the "relocation truncated to fit" problem.

The converse is also a possibility too - it all depends on the inlining
behaviour of the compiler towards static functions, and the resulting
size of the code.

What may be right for one architecture and compiler may not be right
for another.

-- 
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

  reply	other threads:[~2019-03-07 18:08 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07  9:14 Arnd Bergmann
2019-03-07  9:14 ` [PATCH 2/2] ARM: futex: make futex_detect_cmpxchg more reliable Arnd Bergmann
2019-03-07 19:39   ` Nick Desaulniers
2019-03-07 23:48     ` Russell King - ARM Linux admin
2019-03-08  0:04       ` Nick Desaulniers
2019-03-08  9:54         ` Russell King - ARM Linux admin
2019-03-08  8:57       ` Ard Biesheuvel
2019-03-08  9:53         ` Russell King - ARM Linux admin
2019-03-08 10:08           ` Ard Biesheuvel
2019-03-08 10:16             ` Ard Biesheuvel
2019-03-08 10:56               ` Russell King - ARM Linux admin
2019-03-08 10:34             ` Russell King - ARM Linux admin
2019-03-08 10:45               ` Ard Biesheuvel
2019-03-08 10:58                 ` Russell King - ARM Linux admin
2019-03-08 11:55                   ` Ard Biesheuvel
2019-03-11 14:34                     ` Arnd Bergmann
2019-03-11 14:36                       ` Ard Biesheuvel
2019-03-11 16:29                         ` Arnd Bergmann
2019-03-11 16:36                           ` Ard Biesheuvel
2019-03-11 20:58                             ` Arnd Bergmann
2019-03-08 11:55                 ` Dave Martin
2019-03-07 17:19 ` [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Joe Perches
2019-03-07 17:25   ` Russell King - ARM Linux admin
2019-03-07 17:42     ` Joe Perches
2019-03-07 18:07       ` Russell King - ARM Linux admin [this message]
2019-03-07 18:12 ` Nick Desaulniers
2019-03-07 18:21   ` Nathan Chancellor
2019-03-07 22:24     ` Arnd Bergmann
2020-12-12 12:26 ` Marco Elver
2020-12-12 20:01   ` Thomas Gleixner
2020-12-14 10:22     ` Marco Elver
2020-12-14 13:15     ` Arnd Bergmann
2020-12-15  6:09       ` Guo Ren
2020-12-15 11:26         ` Arnd Bergmann
2020-12-15 19:38           ` Sam Ravnborg
2020-12-15 23:24             ` Arnd Bergmann
2020-12-17 15:32               ` Andreas Larsson
2020-12-17 16:43                 ` Arnd Bergmann
2020-12-18 11:08                   ` Andreas Larsson
2020-12-17 20:03               ` Sam Ravnborg
2020-12-16 10:07             ` David Laight
2020-12-16 11:40           ` Peter Zijlstra
2020-12-20 15:44           ` Guo Ren
2020-12-20 17:49             ` Arnd Bergmann
2020-12-21  2:58               ` Guo Ren
2021-07-22 20:05     ` Nathan Chancellor
2021-10-25 13:52       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307180756.z2omra6hhwobhwcc@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=arnd@arndb.de \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=elena.reshetova@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome