Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6388382rwb; Tue, 22 Nov 2022 12:38:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wfu8+fvuASuZhSC5qXdD8scT71uSh6NFPrMrHDD/wUSHPVAFepq3KKrRvng+nbGbZ6/Ut X-Received: by 2002:a17:902:e1cb:b0:189:6f3:63dd with SMTP id t11-20020a170902e1cb00b0018906f363ddmr5709710pla.168.1669149514946; Tue, 22 Nov 2022 12:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669149514; cv=none; d=google.com; s=arc-20160816; b=JkOBpBjvRr82Ixp9QA9XByiA8BtENVdKAasYEHwXiMSzsCbClQIC+OGy/L7KbPV/Nm OKjY+Aabnd8FRALJJTHB6K0u52O4/p0WdYSFe/+41RFcgHzVaZzLvKmejlNPTxTgtznO nDpFLcf2WxW5ithES67n0ZfY5HlsAiBj9EiepGcFLz4Mp+Ku/T5djQBcfbNp6rOvtikC zOwA2cgP/Saae2KVIfilzSkXBEu5le/c3fr/mswVGrR+l19RKz/HBwyjIuigyBU+EBCR mvkt7n4GLxwXLXJN0Viycm/KQx4kT6568pgN9htqXVJi+Fd2ffWy69VWTR5+bZ4Vf23B nkWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=BhOaZEKACOKXBlHohqZcsId9oIupruecAaaKnkWwKts=; b=W1zeYQ+EPVSEVczH+fRbwgNvJchkZybei1kq9hkCXz7fgpPjpngjU5yaLaHcJU3Z9x EBjEhspLEwj4JlB29nEOrzDixR+GFPohrmbUWJ7nK9Og3zVe1rueOvat98WXE2suCFft KmR8Vp+gsxUpEjCGTqp8M2EBMoc1KLKC2fN7QlMjF+fBJg9W1+S7oDMQuqmfmUi7B5Yp jqPJ1Jxwd4OADqaHIj1Wyiun/cIBzzVcA3pWlS5aoOWV56mmSO3O3hihQ+DbvEsnUCVz D59yNIGGqY+IhJYk7GsdIBa5FWKSEMLDP2Q/xERORWlRJx5I1kH4UOflbgzA2p2mmrOe dGCw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a170902c64300b00176e05275d1si11961804pls.423.2022.11.22.12.38.23; Tue, 22 Nov 2022 12:38:34 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234612AbiKVU2S (ORCPT + 90 others); Tue, 22 Nov 2022 15:28:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234079AbiKVU2M (ORCPT ); Tue, 22 Nov 2022 15:28:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F78193F0; Tue, 22 Nov 2022 12:28:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4ED1B81D8F; Tue, 22 Nov 2022 20:28:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A07EEC433D6; Tue, 22 Nov 2022 20:28:06 +0000 (UTC) Date: Tue, 22 Nov 2022 15:28:05 -0500 From: Steven Rostedt To: "Arnd Bergmann" Cc: "Nadav Amit" , "Thomas Gleixner" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-um@lists.infradead.org, Linux-Arch , linux-mm@kvack.org, "Andy Lutomirski" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org, "Richard Weinberger" , "Anton Ivanov" , "Johannes Berg" , "Andrew Morton" , "Nadav Amit" , Peter Zijlstra Subject: Re: [PATCH 3/3] compiler: inline does not imply notrace Message-ID: <20221122152805.6d16afc8@gandalf.local.home> In-Reply-To: References: <20221122195329.252654-1-namit@vmware.com> <20221122195329.252654-4-namit@vmware.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 On Tue, 22 Nov 2022 21:09:08 +0100 "Arnd Bergmann" wrote: > On Tue, Nov 22, 2022, at 20:53, Nadav Amit wrote: > > From: Nadav Amit > > > > Functions that are marked as "inline" are currently also not tracable. > > Apparently, this has been done to prevent differences between different > > configs that caused different functions to be tracable on different > > platforms. > > > > Anyhow, this consideration is not very strong, and tying "inline" and > > "notrace" does not seem very beneficial. The "inline" keyword is just a > > hint, and many functions are currently not tracable due to this reason. > > The original reason was listed in 93b3cca1ccd3 ("ftrace: Make all > inline tags also include notrace"), which describes > > Commit 5963e317b1e9d2a ("ftrace/x86: Do not change stacks in DEBUG when > calling lockdep") prevented lockdep calls from the int3 breakpoint handler > from reseting the stack if a function that was called was in the process > of being converted for tracing and had a breakpoint on it. The idea is, > before calling the lockdep code, do a load_idt() to the special IDT that > kept the breakpoint stack from reseting. This worked well as a quick fix > for this kernel release, until a certain config caused a lockup in the > function tracer start up tests. > > Investigating it, I found that the load_idt that was used to prevent > the int3 from changing stacks was itself being traced! > > and this sounds like a much stronger reason than what you describe, > and I would expect your change to cause regressions in similar places. > > It's possible that the right answer is that the affected functions > should be marked as __always_inline. Actually, this requirement may not be as needed as much today. There's been a lot of work in the last 10 years (when that commit was added) to make ftrace much more robust. We could remove the notrace from inline and then see where it breaks ;-) But I'm guessing that it's probably not as much of an issue as it was before. Although, it may cause some splats with noinstr but I think that will be caught at compile time. -- Steve