Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752774AbcD1PtX (ORCPT ); Thu, 28 Apr 2016 11:49:23 -0400 Received: from mail-db3on0093.outbound.protection.outlook.com ([157.55.234.93]:32016 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752327AbcD1PtV (ORCPT ); Thu, 28 Apr 2016 11:49:21 -0400 Authentication-Results: ucw.cz; dkim=none (message not signed) header.d=none;ucw.cz; dmarc=none action=none header.from=mellanox.com; Subject: Re: [PATCH] scsi: fc: force inlining of wwn conversion functions To: Arnd Bergmann References: <20160419085221.GA29087@gmail.com> <4940273.pi2bWg8tAl@wuerfel> <2544325.pieyAoijz1@wuerfel> CC: Martin Jambor , "Martin K. Petersen" , James Bottomley , Josh Poimboeuf , , , Denys Vlasenko , Thomas Graf , Peter Zijlstra , David Rientjes , Andrew Morton , Ingo Molnar , Himanshu Madhani , , Jan Hubicka From: Chris Metcalf Message-ID: <744a7126-47f7-c325-b208-cab8c30bcc0d@mellanox.com> Date: Thu, 28 Apr 2016 11:48:57 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <2544325.pieyAoijz1@wuerfel> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: BLUPR0201CA0040.namprd02.prod.outlook.com (10.163.116.50) To HE1PR05MB1692.eurprd05.prod.outlook.com (10.169.119.158) X-MS-Office365-Filtering-Correlation-Id: 20f51d7c-fa42-437e-462a-08d36f7ca706 X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1692;2:4qq1Tx8H2Uh54fzC57pZPJiS7S977AZ0pjzNT0XVqmdg+ZhKSYuVq6bB1yZuCLzJSagtDGa8fVQl/JjVJ+XJx+I6FUk2uQEDRAbYAiocTPTg7MIV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-Exchange-Diagnostics: 1;HE1PR05MB1692;20:5sR1ACjVy5IgJaRtRmhlYzsmAnGJDYvZcATYxJAI9AE9eIksr8lSS9R/Rm5qaG/m2i+0sDXOAsjZNfB5WI4Lmhqby57mNIOgbymI+PMxINzZ7EFwe3nA3rRwdR6UYF2fIpuj0iygf+ny2POHOpzPb2ekM/uZjRIUj5M0akfJCmHfTrMq1AgkX1BBVYa4VsvXYUDDF/rxIbTW8ozTbH0z5ohDGqE964QM3RbvIRUzOzA/EOfwQHfWAwVrJ/Uyj2VAd0uJK+FRoVg8/Thz2ix8Axc2yvJPeIRD/PAowBkdMB0B69jkCaIWBw83EnazV4IruecLpY9/X0Jxx1lEiymaWbtKUQmuXxhulxNB1U9AUHV2mDPfvovuigMmGws54J8kpdcpU5hIMK03HkQZ2C6bMQEpUE4kM7gruk4IdSz0+YcObZe1Exx3q+Md3R9KJvC06QMmglGjZxk17a/IQ/GubILyySnCIIyJCybkWGHdaYMwQOEthPWqjQ7qODWq3zqQ;4:lqcEytdSckbe0Yl67Qk8GDA0cC0E2ccnFjzCzWILHzQ3NOgmnB8SYcoucjmjzuBJK5fMszUn7MzXSM7+S+OnKiIG7iQKj4UuR4jXypc+K6nKt6ltQqsyDRERfYSinCYULxCpFUh1lRXafmJFTbB+UTlmfo5TqONuWT9Pg7b/gJhdYkZt+Q6p8r9SODST08hchWyz4ZB156+OiE0axqfnc9N8gT1+LJjJUL4YRgcEMWFgdVXp9nplXMt8DVs33dXFymawSohDGXhFce3G/cvSu8qD4UjBzMfwfFXaQ6Tf3BwBbDW5OA5lLcMJQCw7QpQQekXt/Im7byV0CQwaVi2DkFwr6/pCV2Tc6o3Fg3RKIkmR+5EDraJuKaEjzI5hOj7nByDd2pITwwhFH2497FPXv7bf4117UI7oyV4vvxS4YFY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:HE1PR05MB1692;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1692; X-Forefront-PRVS: 0926B0E013 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(377454003)(24454002)(4326007)(5008740100001)(42186005)(586003)(86362001)(3846002)(2906002)(33646002)(5004730100002)(50986999)(76176999)(54356999)(189998001)(2950100001)(65806001)(65956001)(66066001)(81166005)(47776003)(92566002)(4001350100001)(110136002)(15975445007)(83506001)(77096005)(31696002)(36756003)(50466002)(19580395003)(93886004)(23746002)(6116002)(64126003)(230700001)(1096002)(65826006)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB1692;H:[10.15.7.169];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;HE1PR05MB1692;23:Euh0dsuOTz74gkuldzOJnRKEjwTRdMLYHWG3A?= =?Windows-1252?Q?Qlqz8Kog0ZgCGL3Wocjf12jW428zZtGQ1h1QAtenVfStQs4ogltZBJqg?= =?Windows-1252?Q?+EmQqexFbnSXqq56GrCRv/7oGYzTAeNJdnGsfHwSapI4jBWlrLCWcySf?= =?Windows-1252?Q?PSHUIUqL5kyiaH74TRXilKV7cdPsWEODM6GQxsm5HJFSP9tY1PZ0YzN7?= =?Windows-1252?Q?H18HSaQCF3eCrfovDuNenkrYsSXszheM30Nr5mcAyyEKZYpUrUEdl62x?= =?Windows-1252?Q?6k45d9s3N6zkABl4Av4rp/HWFT+g4sm0VJTtRPYZHEuBCD77hfgfop3o?= =?Windows-1252?Q?WnCXtpoq8Sbo0xx1VyyH4fkOA6Q3gZIm7tLgSsxoOmA7KX9iew7EptJw?= =?Windows-1252?Q?yiDklZuopPPdbMXeG4g60XDdzbg1TKAbGtlFp0KU6h1VJI8N0eYCB1TU?= =?Windows-1252?Q?BdaG3t6n84Uuhy2MGRHm7/+JHkruZ3Io0OO4U2xFrmrozbwJTCvlrRH0?= =?Windows-1252?Q?FSBmOTj+cOf4LmLxzx46c83sVqksoKM56VM17oAzdPQNeuENloGfOVy6?= =?Windows-1252?Q?TA8MC9fo0HW4Tzq7gCWZpuXG4uPFEoUE/Nx/3N/+9WhD/YgeACf3AU4e?= =?Windows-1252?Q?f6hMFfk/Lf0iK9XiQNcLbFgMR22D3iHsDtZkyanGkGatzRPWympiPRHo?= =?Windows-1252?Q?z2gOFuoOGN92FaHuVhRA5foezEQLuikLfCuneKKlAEhnDF1H05egenpQ?= =?Windows-1252?Q?V9zhSXMNq9JZ4NbbS/6tYVy+a/Lbhgjv1ZXsbGv/4WmsLTFt54ZfGoQm?= =?Windows-1252?Q?5c4246HHwcOSs/kKII/2cL/w9VepI5O5cEaQWeboMouH5Yik/nWMHaYi?= =?Windows-1252?Q?Q4qDQF9zQ3X/+UGXzkeJbFs5XyhY8PCxBJTq6t8R0CU8p2nkuT94zP+L?= =?Windows-1252?Q?Ax3tbFZhSO+nuFGnaEfVPcAvXmlhrCagNuLRE+CnaupE6re8lvRd1k2i?= =?Windows-1252?Q?RzH78N8OZED4z1jSZp5VHAYYhR0vmq99yKSDJzItC7d5d9k1iO+gzT2M?= =?Windows-1252?Q?ld7cq+xx2MM5k/Mv4a55pgEhDMJQvwWBPfOztKUtEen5vz40v1pNY677?= =?Windows-1252?Q?PtebbF6dLFawz+B/+YmK75LWzaWIQeOEFUj+v4b+FFiA/aaxaZh0iLWe?= =?Windows-1252?Q?3asRvVH1MXdPWBG+CCvaU3dIF3OeE8=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1692;5:vGfjK1q1HkBKvSkjlnm7jAG8RhBsB2zl7dxelI/86nABte5iakjTFHann5GDCuMpyN20Ry8X3idGxx5xPhrkhtG/2u4yT/ekzNlaoUQPM74LP+rhT7TlzN3hFa6st5rf0nARHlsTGioukydE+qWTnQ==;24:k3K2lBFZNhGwiWwZiL4JDHVi5kzRqGouk7iV603v7xCMlqTHpHlfGza1itYZ3bVZWApivVgdc19h251W2HLSblm2mJ+x0T4LA8dr0mqgRDY=;7:tyj1a3lUKGeKz1FnoVKjX9GORbEfE1xrEcY0c2yjfiWb5DeRyA7+jPAbDY5ELhrkpFTlgGpsoLscvUfqF0Mc7myhj5OZbDSdxx7nyOoGr334m50OiJU5viyyfDIFjtc4tvkzGGAOq0j5i/leNZdpYxNHgyoqukrfNs2qoJPdznaYTGR4TMJ/7y39IbGXBqa2 SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2016 15:49:13.4455 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1692 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2574 Lines: 52 On 4/28/2016 11:23 AM, Arnd Bergmann wrote: > 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? I don't have an affected build of gcc handy (just 4.8 and 4.4). I will pass this to our compiler folks and see what they know. > 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. This does seem like a more robust solution anyway, since more instances of the bad inline pattern might get introduced in the future in other places. I wouldn't make it conditional on ARCH_USE_BUILTIN_BSWAP for the same reason. -- Chris Metcalf, Mellanox Technologies http://www.mellanox.com