From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0A3DC32771 for ; Fri, 19 Aug 2022 15:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349769AbiHSPcw (ORCPT ); Fri, 19 Aug 2022 11:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349756AbiHSPcw (ORCPT ); Fri, 19 Aug 2022 11:32:52 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA218101C72; Fri, 19 Aug 2022 08:32:49 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 27JFLw53006284; Fri, 19 Aug 2022 10:21:58 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 27JFLvQc006283; Fri, 19 Aug 2022 10:21:57 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 19 Aug 2022 10:21:57 -0500 From: Segher Boessenkool To: Menglong Dong Cc: Nick Desaulniers , kuba@kernel.org, miguel.ojeda.sandonis@gmail.com, ojeda@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, asml.silence@gmail.com, imagedong@tencent.com, luiz.von.dentz@intel.com, vasily.averin@linux.dev, jk@codeconstruct.com.au, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kernel test robot , linux-toolchains Subject: Re: [PATCH net-next v4] net: skb: prevent the split of kfree_skb_reason() by gcc Message-ID: <20220819152157.GO25951@gate.crashing.org> References: <20220816032846.2579217-1-imagedong@tencent.com> <20220818165838.GM25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org Hi! On Fri, Aug 19, 2022 at 10:55:42PM +0800, Menglong Dong wrote: > Thanks for your explanation about the usage of 'noinline' and 'no_icf'! > I think 'noclone' seems enough in this case? As the function > 'kfree_skb_reason' we talk about is a global function, I think that the > compiler has no reason to make it inline, or be merged with another > function. Whether something is inlined is decided per instance (except for always_inline and noinline functions). Of course the function body has to be available for anything to be inlined, so barring LTO this can only happen for function uses in the same source file. Not very likely indeed, but not entirely impossible either. A function can be merged if there is another function that does exactly the same thing. This is unlikely with functions that do some serious work of course, but it is likely with stub-like functions. gl;hf, Segher