Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5221611imb; Thu, 7 Mar 2019 10:22:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzL9NhX7DPTD/xGJZq7eJLgbgG2baFQ4xjSHE+QzMaNMy63mmZgX1LLHiq5aXaqrrHX5h4A X-Received: by 2002:a63:68c9:: with SMTP id d192mr12895063pgc.264.1551982942637; Thu, 07 Mar 2019 10:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551982942; cv=none; d=google.com; s=arc-20160816; b=0FzohfkR+66O5ngSpqAHjlTKFsi8FGCXpSY0zprD4eZ3iL74qwkUTs60dFWKEudamS Vx1wBnPFHboIbNoloefEzVANdF/BSeMZB4Qmfg2Cwj7Ur1c/uAQELDBvyeN6Tq3y8+YH G7dDfINX7AMXIWIkEsMaGOIJAT1HoPHlMS3zoap1Kc084ZmUhRya+pM3I9G9I67D2wI9 x6jw2kCYMYavNNLT7b3J/wHOvDggDrfZ7mexh98VT48B9uyfnGGSbM2xtsJsiY6kUYV2 1V+iIoXipkeG+c/pVonUzaCTtsLRo7ps+UopYC4cHstujZboF9/Cutq4x862FeIrO722 g3MA== 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=Mv2sVwkvOpOsKziBy6PS3WwnrK94oVNASHk9Btsx/9s=; b=H0kX6CkAtK2iXhUlgKyk3AmOsKzCZEc5b7HzZU9ZBWKwrj2PfL+dqRSV35UHatR8ZQ yCjc4OmXo8KeVBxsHzT2Ff6Jwfytd6r5DZut9+osGaG4lbXy2RJfS3biUS3T1URhhNS3 EgcBKzZVCNsv9YLnEvhAwtUMynH9Hj171SBzffQkkh4r2njzZWrIXGOFl+dG5d6WBoXl 0y6tgelA+MV60PtROMUZ/9xCetpomofLegJW3z52eRjrkN7G+3qwBnIH7eLvFv+cvfg0 AhNWOvVkD+1svOlBDbKSBvAg4Y8pSPVLizNyripFitk+rHt2nwrMHaM0sHA3anUU95iD PhTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="qPn53MN/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d69si4138490pgc.589.2019.03.07.10.22.06; Thu, 07 Mar 2019 10:22:22 -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=pass header.i=@gmail.com header.s=20161025 header.b="qPn53MN/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfCGSVI (ORCPT + 99 others); Thu, 7 Mar 2019 13:21:08 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37138 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfCGSVH (ORCPT ); Thu, 7 Mar 2019 13:21:07 -0500 Received: by mail-ed1-f67.google.com with SMTP id m12so14293295edv.4 for ; Thu, 07 Mar 2019 10:21:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Mv2sVwkvOpOsKziBy6PS3WwnrK94oVNASHk9Btsx/9s=; b=qPn53MN/I08THXX9Z7mQttZAfKk+9dtH6bef4Vze3DTxMvoLXn/nHPtxsqGRbGfy7O hk4aX40EX0xaxQjNOgGVoyPdR+Frl82BJE6MYzcKg7s8ewc2IExXpBg1N1EsQC2WiCEs VRiS71968smrR/Elm8kp9zti8LrgmP4t2jCGEI5CqhvyTBkfskcLinLwzPvRmDdtF1xx qa94PY3wTLC5T+0u8/z7kq+xIzlm+/PfpK9A8XeZCml/eOWuXm2g4AWWf8LpnWrkz5jo coo81x+Xo+cq57+RU0zowBRrKfjHmTpYricQ1z81N1XQVIa0xmvrlwPuMqfnAIXfhl06 kACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Mv2sVwkvOpOsKziBy6PS3WwnrK94oVNASHk9Btsx/9s=; b=bilywUfjDbWKWstnF27wGNcQYxA1yR25hGNT4eG5lUrnGy2c4CmBUOTbkpFVKICI0D DhvqDdmGTI09e/SZzmG2AKou4C9768/aCfEN31KKp8KNzyznKMUguDTU6N5sxedcq/Dj nQ8krb9rtWXDoqtvUW9P8naKYm/1CxRff/MVGepvnhuoDK4oFjthCORasjXdYzOdEMi/ jyvF0OmHZZP+quBE+sHH+wuONXymYol4pdIxR3oAUS26P7/lb+zxEd+TAiob41wMoBsa K3YwD3pLc4U6UAeXuYIBtJbluLomBvmateuBzkIDsJ/0TWhEV59QHeOTaS2zx5pkmgR3 9D/g== X-Gm-Message-State: APjAAAUeA8aHk0cZfxyE5qE1yfCu29g1Yy6lyVlXKhuPPRNHapoXdk/w VghYDp6J02HinLUeH7wXtOA= X-Received: by 2002:a50:b646:: with SMTP id c6mr29549509ede.149.1551982865969; Thu, 07 Mar 2019 10:21:05 -0800 (PST) Received: from archlinux-ryzen ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id g24sm1540943edc.67.2019.03.07.10.21.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 07 Mar 2019 10:21:04 -0800 (PST) Date: Thu, 7 Mar 2019 11:21:02 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Arnd Bergmann , Russell King , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Elena Reshetova , Greg Kroah-Hartman , LKML Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Message-ID: <20190307182102.GA12466@archlinux-ryzen> 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: Mutt/1.11.3 (2019-02-01) 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 10:12:11AM -0800, Nick Desaulniers wrote: > On Thu, Mar 7, 2019 at 1:15 AM 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' > > Do we know what function from the fixup text section is calling > futex_detect_cmpxchg? I'm curious if this is maybe another case of > -Wsection where some function may be in the wrong section? > Looks like this is the call stack: futex_init -> futex_detect_cmpxchg -> cmpxchg_futex_value_locked -> futex_atomic_cmpxchg_inatomic This is the same issue I reported: https://github.com/ClangBuiltLinux/linux/issues/325 Marking arm's futex_atomic_cmpxchg_inatomic as noinline also fixes this so maybe that's it? Cheers, Nathan > > > > 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. > > > > Signed-off-by: Arnd Bergmann > > --- > > kernel/futex.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/futex.c b/kernel/futex.c > > index c3b73b0311bc..dda77ed9f445 100644 > > --- a/kernel/futex.c > > +++ b/kernel/futex.c > > @@ -3849,7 +3849,7 @@ SYSCALL_DEFINE6(futex_time32, u32 __user *, uaddr, int, op, u32, val, > > } > > #endif /* CONFIG_COMPAT_32BIT_TIME */ > > > > -static void __init futex_detect_cmpxchg(void) > > +static noinline void futex_detect_cmpxchg(void) > > { > > #ifndef CONFIG_HAVE_FUTEX_CMPXCHG > > u32 curval; > > -- > > 2.20.0 > > > > > -- > Thanks, > ~Nick Desaulniers