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 ECC58C4332F for ; Tue, 15 Nov 2022 15:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231307AbiKOPSC (ORCPT ); Tue, 15 Nov 2022 10:18:02 -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 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