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 AED51C38145 for ; Wed, 7 Sep 2022 18:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbiIGS7o (ORCPT ); Wed, 7 Sep 2022 14:59:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbiIGS7m (ORCPT ); Wed, 7 Sep 2022 14:59:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBD5C13F05 for ; Wed, 7 Sep 2022 11:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662577179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ixVu03txVJzmfV2UPML9i8C++ZJ1T0md3aHETXx0ojs=; b=CN05hjC/qLwSyq/90ewM7eqHWGo3ae9pqkXutnPz5VMuO1jEvmBSlfkrHGg5uF5JAS9ryY kN5WWQui5Uk4nuHa+6krWN4sr4cSi1HKNyHbxtumnSO2S2JdB6EpMk3y9KOSnQwe8TyjtL dVNHs5FtCW9pX2ngcjZqZtt7YEq1ioY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-632--eRPXiNMNTmzIghSLtL2zQ-1; Wed, 07 Sep 2022 14:59:34 -0400 X-MC-Unique: -eRPXiNMNTmzIghSLtL2zQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 034903C1104B; Wed, 7 Sep 2022 18:59:33 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.194.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 023D840CF916; Wed, 7 Sep 2022 18:59:28 +0000 (UTC) From: Florian Weimer To: Segher Boessenkool Cc: Menglong Dong , 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 References: <20220816032846.2579217-1-imagedong@tencent.com> <20220818165838.GM25951@gate.crashing.org> <20220819152157.GO25951@gate.crashing.org> <871qt86711.fsf@oldenburg.str.redhat.com> <87edwo65lw.fsf@oldenburg.str.redhat.com> <20220906153046.GD25951@gate.crashing.org> Date: Wed, 07 Sep 2022 20:59:26 +0200 In-Reply-To: <20220906153046.GD25951@gate.crashing.org> (Segher Boessenkool's message of "Tue, 6 Sep 2022 10:30:47 -0500") Message-ID: <87zgfbnh81.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Segher Boessenkool: > On Tue, Sep 06, 2022 at 02:37:47PM +0200, Florian Weimer wrote: >> > On Mon, Aug 22, 2022 at 4:01 PM Florian Weimer wrote: >> > I did some research on the 'sibcalls' you mentioned above. Feel like >> > It's a little similar to 'inline', and makes the callee use the same stack >> > frame with the caller, which obviously will influence the result of >> > '__builtin_return_address'. > > Sibling calls are essentially calls that can be replaced by jumps (aka > "tail call"), without needing a separate entry point to the callee. > > Different targets can have a slightly different implementation and > definition of what exactly is a sibling call, but that's the gist. > >> > Hmm......but I'm not able to find any attribute to disable this optimization. >> > Do you have any ideas? >> >> Unless something changed quite recently, GCC does not allow disabling >> the optimization with a simple attribute (which would have to apply to >> function pointers as well, not functions). > > It isn't specified what a sibling call exactly *is*, certainly not on C > level (only in the generated machine code), and the details differs per > target. Sure, but GCC already disables this optimization in a generic fashion for noreturn calls. It should be possible to do the same based another function attribute. Thanks, Florian