Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'
From: Russell King - ARM Linux admin
Date: Thu Mar 07 2019 - 12:26:10 EST
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