Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbcD1PZN (ORCPT ); Thu, 28 Apr 2016 11:25:13 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:51985 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752714AbcD1PZI (ORCPT ); Thu, 28 Apr 2016 11:25:08 -0400 From: Arnd Bergmann To: Chris Metcalf Cc: Martin Jambor , "Martin K. Petersen" , James Bottomley , Josh Poimboeuf , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Denys Vlasenko , Thomas Graf , Peter Zijlstra , David Rientjes , Andrew Morton , Ingo Molnar , Himanshu Madhani , qla2xxx-upstream@qlogic.com, Jan Hubicka Subject: Re: [PATCH] scsi: fc: force inlining of wwn conversion functions Date: Thu, 28 Apr 2016 17:23:31 +0200 Message-ID: <2544325.pieyAoijz1@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <20160419085221.GA29087@gmail.com> <4940273.pi2bWg8tAl@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:f3sTCR0pjKzvUEfTWHAWEeNkZDzga2ljBk1HxdfpYjjg86HJZyP ddiHW770AWhRBPjy27nAIx8YbRLNOCuTwFx0vhXSsT+x0Zo/1h1cUiYVwPXzy/Nfv9NQExg AUuz9jC2DLOgCTi/H9lLKMLdVMNrzhX1N39r09vttaC77HzIyxAaBM1IBX2TkLHqF8XMzpi 1QzuiYSRoiqccXXVjegVQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:RQl3xHScU7U=:RWBJIWRA7tRX4NEmJdgUwo ey5ia78V57Br/s51twqx3zUbKaBvDSihqR8Hv7KCKxZ+6obUHBK8ANhscOtbIF8h+fnuOoW0N nGumuTTknoMBGm1CryzY+9oVRDso6IZP5om95cFX+k+ZZyHy+hJ56A01rYvAk9aT7kUR1ou4f NjOfUEuBdUre9jgV7b1ftjOl3PJeDLPdc/bOHBrdG7Vc8930axPWshTf04uM1yef/zeY/vlmh eaZ9SeJg2XFEBWXTm1K50SSg9vs2g+4xPw4KvSPbqdSsHduDpbPjAXysw2NWGT6QiI72Kjmv9 iyyuMDvEPfr4aUrmRoS+daMpFYE6HhM88emzV8YTQaXluBIr2LxtaPbHQtdvRDr6L0LvrdUKV infHe3zRqePhcg5Tdv3ogN9VqN9WzOBYCb+5vA/vs8p09Dc8s7wWmG2BMhgKtbYCcuO8yogKQ 0mhKhsIRNkbxYJG+6GP8fThBL/zZwnFug519ZSM9LTFvGAunOJJfdAGL9+5GsPLL/kFsZG1Mb YLZ9TGES55Mne3xeY9hbV06xssVKgfwovcE4EFccLQJBdK/bRnt3BUjdTdwB5PEZVngpf2FCz BoMVP9HY2zPxrH9SVX87EaqN1ARNhFxD/Jahm2JP9WsZ2u10mBYKxLNYB2C3RSJvjma6BlClp ND6qMdPWsRgygezP2+UtaqzS9Zu2s/FifFzQqyn07C1dC2w+/ccACKXA6LuAxBd1leApM3ISc crbSMDtOvAEETe38 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2065 Lines: 44 On Thursday 28 April 2016 10:58:43 Chris Metcalf wrote: > (Resending as text/plain) > > On 4/27/2016 5:34 PM, Arnd Bergmann wrote: > > This won't help on TILE, which is the one architecture that sets > > ARCH_SUPPORTS_OPTIMIZED_INLINING but does not set ARCH_USE_BUILTIN_BSWAP. > > Chris Metcalf should be able to figure out whether we can just > > set ARCH_USE_BUILTIN_BSWAP for tile as well. > > We certainly could enable ARCH_USE_BUILTIN_BSWAP. The only problem is > that we never added explicit support for bswap16() in gcc, which is > efficiently done on tilegx via the "revbytes" instruction and a 48-bit > right-shift. So gcc instead does a generic thing with four > instructions in three bundles, so really not as good as our asm/swab.h. > > I'm not sure how to weigh the implications of converting to > builtin_bswap16 (and possibly upstreaming a better implementation to > gcc), vs. disabling ARCH_SUPPORTS_OPTIMIZED_INLINING (which no one > else but x86 uses anyway), vs. just ignoring the compiler bug and > hoping it's not an issue in practice How about figuring out whether you hit the gcc bug on tile as a first step? Another idea would be to adapt this section in include/linux/compiler-gcc.h: #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) #define inline inline __attribute__((always_inline)) notrace #define __inline__ __inline__ __attribute__((always_inline)) notrace #define __inline __inline __attribute__((always_inline)) notrace #else /* A lot of inline functions can cause havoc with function tracing */ #define inline inline notrace #define __inline__ __inline__ notrace #define __inline __inline notrace #endif to work around the issue. We already check for gcc before 4.0, and we could also check for the affected releases (4.9, 5.x, 6.1) in the same place, possibly conditional on ARCH_USE_BUILTIN_BSWAP with a comment pointing to the gcc bug tracker. Arnd