Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4309426rwb; Tue, 6 Sep 2022 05:54:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR5DhkrCwkOb76Q4AYcHfcu43x9B5TIIFeGI6S5WPnfT7D5vqB1qDpMq6kXlI+/FCVKm78XE X-Received: by 2002:a05:6402:428e:b0:443:8279:13ea with SMTP id g14-20020a056402428e00b00443827913eamr47876018edc.294.1662468891683; Tue, 06 Sep 2022 05:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662468891; cv=none; d=google.com; s=arc-20160816; b=pN7Mmc+k13hv4MFhmGSigzc0zAMZfxbv1dC2wkM81MYGJoK2uxOURRPgCsdRsFPDNc 0NvWfzFIrrtENDhkI58CvIu1fOsQfR4qM/8ED9azhFjoe7o6hYeaY/UquGKi8Rd98+fB NwdtnFr/OeVPN330FgwE70+YTWZkig9ykJqBVwcmIPqbKjfbaNMOKS1mG8apZLxSL4kj XhG+gFFr3P70lEd8PSZVJIsPkV/ujKwD62T1MEb0ZA/IWefTMJl03c37JmyFPgKX/mMB 8fP4UNcWpe4IvNSRNtn/pmRZK2zICQmPVJZjqUCrWEHjLmHilF/jHAReu2hQP2F9Z8G6 Mkng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=NwavP4bpJ5RCOsyXBh4N8THSIxStyZegdjcyZhUquBU=; b=WN5zOBGtPQnPEQX+gWryvG26stIZyAdquxG6mcmbeZ6RDUWa2AITX+fff6LJql4Fe9 URUrwwbjYRG4dQJYWLNtpGo/aGC/PsMQegTS8Bi1/eNt7c/PM1/o9AeKZ97Fu02wdFh8 m4JCGzAT5OoaHSjQ47zjgGK9pM9PuzgZN7+vrRkVAL/iGMFQZgC3DWaWjPWrgVqC0scP HrBrHm5Nq9wRD7EI0EpTeYnXMRnHFy7xZ2EgiBG7lxe3OL66+9TyVi/npuB6EhqUd1Ki Q+zG8nZWmgrQi26SVzQFWyDoubHRzbUXwMw9dgMFYdbWNCsJcDjBlfFJf0si2X0aOsAr dbIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HSM1vJno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y38-20020a50bb29000000b0044eab56accfsi3091231ede.59.2022.09.06.05.54.25; Tue, 06 Sep 2022 05:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HSM1vJno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239795AbiIFMh7 (ORCPT + 99 others); Tue, 6 Sep 2022 08:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239732AbiIFMh6 (ORCPT ); Tue, 6 Sep 2022 08:37:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D502225E87 for ; Tue, 6 Sep 2022 05:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662467877; 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=NwavP4bpJ5RCOsyXBh4N8THSIxStyZegdjcyZhUquBU=; b=HSM1vJnoyWpCDNHo/iU4kQKQEiG9QSQcN2fO5jQdiqn6guOgdMD07Z6Ap0FN5aOuuDKYSc SIew0bhtxNFFvcTTvSPjmIoRE46ZweZlwC6gejhE+cCLdlhRSpngxpaaPCPEQjRWs9MiYv zzG6H87glJMJ1QZhxGCwc9rEER+7pgI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-15-xyxTHjOaPfqDg-3_GN9Jlw-1; Tue, 06 Sep 2022 08:37:56 -0400 X-MC-Unique: xyxTHjOaPfqDg-3_GN9Jlw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EF72101A54E; Tue, 6 Sep 2022 12:37:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 968181121314; Tue, 6 Sep 2022 12:37:49 +0000 (UTC) From: Florian Weimer To: Menglong Dong Cc: Segher Boessenkool , 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> Date: Tue, 06 Sep 2022 14:37:47 +0200 In-Reply-To: (Menglong Dong's message of "Wed, 24 Aug 2022 00:23:02 +0800") Message-ID: <87edwo65lw.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.78 on 10.11.54.3 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Menglong Dong: > Hello, > > On Mon, Aug 22, 2022 at 4:01 PM Florian Weimer wrote: >> >> * Menglong Dong: >> >> > /* >> > * Used by functions that use '__builtin_return_address'. These function >> > * don't want to be splited or made inline, which can make >> > * the '__builtin_return_address' got unexpected address. >> > */ >> > #define __fix_address noinline __noclone >> >> You need something on the function *declaration* as well, to inhibit >> sibcalls. >> > > 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'. > > 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). asm ("") barriers that move out a call out of the tail position are supposed to prevent the optimization. Thanks, Florian