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 E0661C4332F for ; Wed, 13 Oct 2021 02:30:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1D0C60F23 for ; Wed, 13 Oct 2021 02:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235550AbhJMCcs convert rfc822-to-8bit (ORCPT ); Tue, 12 Oct 2021 22:32:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:43816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbhJMCcq (ORCPT ); Tue, 12 Oct 2021 22:32:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE40C6101D; Wed, 13 Oct 2021 02:30:40 +0000 (UTC) Date: Tue, 12 Oct 2021 22:30:39 -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 , Colin Ian King , 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 1/2] ftrace: disable preemption on the testing of recursion Message-ID: <20211012223039.78099c24@oasis.local.home> In-Reply-To: <1eab20c1-d69b-f94b-92ff-4329d0aff6a2@linux.alibaba.com> References: <8c7de46d-9869-aa5e-2bb9-5dbc2eda395e@linux.alibaba.com> <20211012084331.06b8dd23@gandalf.local.home> <1eab20c1-d69b-f94b-92ff-4329d0aff6a2@linux.alibaba.com> X-Mailer: Claws Mail 3.18.0 (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: linux-kernel@vger.kernel.org On Wed, 13 Oct 2021 10:04:52 +0800 王贇 wrote: > I see, while the user can still check smp_processor_id() after trylock > return bit 0... But preemption would have already been disabled. That's because a bit 0 means that a recursion check has already been made by a previous caller and this one is nested, thus preemption is already disabled. If bit is 0, then preemption had better be disabled as well. -- Steve