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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE9F9C433EF for ; Wed, 27 Oct 2021 02:55:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B737F61152 for ; Wed, 27 Oct 2021 02:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237738AbhJ0C6W convert rfc822-to-8bit (ORCPT ); Tue, 26 Oct 2021 22:58:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:39980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238780AbhJ0C6V (ORCPT ); Tue, 26 Oct 2021 22:58:21 -0400 Received: from rorschach.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03365610C7; Wed, 27 Oct 2021 02:55:53 +0000 (UTC) Date: Tue, 26 Oct 2021 22:55:52 -0400 From: Steven Rostedt To: =?UTF-8?B?546L6LSH?= Cc: Guo Ren , Ingo Molnar , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masami Hiramatsu , "Peter Zijlstra (Intel)" , Nicholas Piggin , Jisheng Zhang , linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, live-patching@vger.kernel.org Subject: Re: [PATCH v6 1/2] ftrace: disable preemption when recursion locked Message-ID: <20211026225552.72a7ee79@rorschach.local.home> In-Reply-To: <78c95844-16b7-8904-b48d-3b2ccd76a352@linux.alibaba.com> References: <78c95844-16b7-8904-b48d-3b2ccd76a352@linux.alibaba.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=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org On Wed, 27 Oct 2021 10:34:13 +0800 王贇 wrote: > +/* > + * Preemption will be enabled (if it was previously enabled). > + */ > static __always_inline void trace_clear_recursion(int bit) > { > + WARN_ON_ONCE(bit < 0); Can you send a v7 without the WARN_ON. This is an extremely hot path, and this will cause noticeable overhead. If something were to call this with bit < 0, then it would crash and burn rather quickly. -- Steve > + > + preempt_enable_notrace(); > barrier(); > trace_recursion_clear(bit); > }