Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7106847rwb; Tue, 15 Nov 2022 07:46:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Kmb7FMQh0F7X/Tbk0j3UcM17Xjg8dMMe/ki56HLuyQ1s/vdngO8KZo2U0tr23bF9M/+aS X-Received: by 2002:a17:906:eb5b:b0:78d:47c8:e80f with SMTP id mc27-20020a170906eb5b00b0078d47c8e80fmr14201428ejb.700.1668527215746; Tue, 15 Nov 2022 07:46:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668527215; cv=none; d=google.com; s=arc-20160816; b=XzlWbQzVTvDusDP2yIao79I8C2GFGPsxhTVV1ZQPEJmSGRM5m6wXwy6kQ3hMK1tiba 5HMDfyc9cfwpWVsCLjAO5TKgaqLRnCt8LZl4mSsvz5w3Qvqa2Ag0JtlXqh6h5adrluDJ DCfktCp/cBdUVtEE7w7Rl/v5rps2IyS8/vvi6ZNowCY//mLs9EBizx6pdmULrMRyhHtM vdHLeTyWloqN3XxDDJpZVdl6WCVOUrTFx0dRNvuJ0EeMmwvXK59fCjTyM/HbEFdFdj5Z bpRYw5BNcXRBF9sp5hbqJ1BRexzrvOm5XNyYhKGDTlHHPNJ7GsVnd/heJwHxoW+S4U9T x+kA== 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=1feTfNYSuHk7dYPj2MgV1jX2K84C+P+XIgkbYX/RUXs=; b=Ly0qJgLWbLTgVT/ppD7NnGS7uCYa+nANDITgfuUmsFNA9Tmov0kIojoqMdWh670HRX 3VKT1CuYmbNLUgP3dU9gY2HCTPY6sO4Suf8WCWegVqk6v4VAfQ+l6JiaISHsbf5l+jHE gRnnaT4z4rbW6ZZZaD0Ez6bffaxwWy4D38NwLE222uJmmyb4vcj9oF2VyyWFT8ma69/k Dy9IQhN6p2J68+lc/zwQzTJPKcTN+OC9Kqedsby2mU3uTacHpAS3ims8cKoDHCG8hTok P2UjTFDtIYVOHtp28KtQDogJGD9VMnwFM3cYC8XAnVp3ONNnFa3FiV6mmUhvRdEXNluL MfmQ== 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 ga5-20020a1709070c0500b0079d5da30399si12664465ejc.427.2022.11.15.07.46.34; Tue, 15 Nov 2022 07:46:55 -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 S231256AbiKOPSB (ORCPT + 91 others); Tue, 15 Nov 2022 10:18:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbiKOPR6 (ORCPT ); Tue, 15 Nov 2022 10:17:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AB212982C for ; Tue, 15 Nov 2022 07:17:57 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EE48261867 for ; Tue, 15 Nov 2022 15:17:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 900EDC433C1; Tue, 15 Nov 2022 15:17:55 +0000 (UTC) Date: Tue, 15 Nov 2022 10:18:37 -0500 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Jianlin Lv , alison.schofield@intel.com, davidgow@google.com, thunder.leizhen@huawei.com, jianlv@ebay.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tracepoint: Allow livepatch module add trace event Message-ID: <20221115101837.37da9d1e@gandalf.local.home> In-Reply-To: <20221116000707.a8a692e377d8daaf3764ee64@kernel.org> References: <20221102160236.11696-1-iecedge@gmail.com> <20221114122255.72588f45@gandalf.local.home> <20221114220216.05dd0541@gandalf.local.home> <20221116000707.a8a692e377d8daaf3764ee64@kernel.org> 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 Wed, 16 Nov 2022 00:07:07 +0900 Masami Hiramatsu (Google) wrote: > BTW, now the kprobe_ftrace_handler() uses ftrace_test_recursion_trylock() > to avoid ftrace recursion, is that OK for this case? Note, the ftrace_test_recursion_trylock() only prevents "same context" recursion. That is, it will not let normal context recurse into normal context, or interrupt context recurse into interrupt context. It has the logic of breaking up into 4 levels: 1. normal 2. softirq 3. irq 4. NMI It allows the high levels to recurse into lower levels (e.g. irq context into normal context) Thus, the code within the ftrace_test_recursion_trylock() must itself be re-entrant to handle being called from different contexts. -- Steve