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 104C6C4332F for ; Wed, 27 Oct 2021 03:09:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE00E610E5 for ; Wed, 27 Oct 2021 03:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238943AbhJ0DMD (ORCPT ); Tue, 26 Oct 2021 23:12:03 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:54044 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238941AbhJ0DMC (ORCPT ); Tue, 26 Oct 2021 23:12:02 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R991e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=30;SR=0;TI=SMTPD_---0UtqSqrG_1635304169; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UtqSqrG_1635304169) by smtp.aliyun-inc.com(127.0.0.1); Wed, 27 Oct 2021 11:09:31 +0800 Subject: Re: [PATCH v6 1/2] ftrace: disable preemption when recursion locked To: Steven Rostedt 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 References: <78c95844-16b7-8904-b48d-3b2ccd76a352@linux.alibaba.com> <20211026225552.72a7ee79@rorschach.local.home> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Wed, 27 Oct 2021 11:09:29 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211026225552.72a7ee79@rorschach.local.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org On 2021/10/27 上午10:55, Steven Rostedt wrote: > 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. I see, if the problem will be notified anyway then it's fine, v7 on the way. Regards, Michael Wang > > -- Steve > > >> + >> + preempt_enable_notrace(); >> barrier(); >> trace_recursion_clear(bit); >> }