Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp244022pxb; Fri, 15 Oct 2021 04:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNhVZ5Se6yemSeyegjvWJDCWfrmT0jkwP23818IJ96EtvZCX1gWup825KP8mljUVl3lYE2 X-Received: by 2002:a63:1d7:: with SMTP id 206mr8759165pgb.387.1634298546349; Fri, 15 Oct 2021 04:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634298546; cv=none; d=google.com; s=arc-20160816; b=zawub67C431Xto8RScRG3jygXEN2D9D/S5MV7CzP0q0XNSvUjxwB5e/unIE+f3IJqo s6YwAnn00vlWswgt7pOofgbQ6mjlcQYk4cv/sj+Qk2z0nJYXDtmPcrtd1g7vjn0rh8BF rG67snLJXxb8VQrfuzvwvOfWwSHNT1KU3AgllLCmLhlFE411JElIvNKp/fZaw/VzT2J9 foTdt3oJKIZ3FrRYuMJ51+sKz07T5UYdHI5mA+0gqNywEgs93KeZDArwF6PmIQ6ePT29 YhJQeSezMiArkuYWMeETYCA14SHDQ1kUeprtBH1oTr9oxi8nLuq6Gyw6ZJZ/EhDBNNFU /z6A== 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=t1fmODjQp1XqJOR8xZ15sowiBEukAx3iKEyttYdW0hw=; b=aaxUkGNpnEIZEG29Qix2CfgchbntZ5ElmqVj38+hdLuFv3exO1nXyq7VuEJqGl7FAC E0GRLXT5zCebXLC5Xb650U0Cci/uOOkqHFm+pzc2Ig0AfMOAmmMwwhrCQd2Kde6fdXWb tLfrpokpgpoCGnuhhR6W4RyInwcaHGvUkGNiP/lcXUib2r6nzxt75uU6IO4amGhQSfvw wKdHl7XCMwUH+I4+it5LcNa69CEjX3exyNzQIT2Qi/5RHn/x5l4bj7V4G1tkjQTlmq8W Gm0ZRpxWHetXkKCPNcfqbIxsVqT0xTyYlSJDsgnunCH4M9PcaU93t+vHecvwW5lSpnSs 7+kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si8880067pgv.167.2021.10.15.04.48.47; Fri, 15 Oct 2021 04:49:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235216AbhJODlV (ORCPT + 99 others); Thu, 14 Oct 2021 23:41:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234139AbhJODlT (ORCPT ); Thu, 14 Oct 2021 23:41:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 038EC610D2; Fri, 15 Oct 2021 03:39:09 +0000 (UTC) Date: Thu, 14 Oct 2021 23:39:07 -0400 From: Steven Rostedt To: Petr Mladek Cc: =?UTF-8?B?546L6LSH?= , 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 , 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 v3 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock() Message-ID: <20211014233907.15f13f62@oasis.local.home> In-Reply-To: References: <609b565a-ed6e-a1da-f025-166691b5d994@linux.alibaba.com> <7e4738b5-21d4-c4d0-3136-a096bbb5cd2c@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=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Oct 2021 17:14:07 +0200 Petr Mladek wrote: > /** > * ftrace_test_recursion_trylock - tests for recursion in same context > * > * Use this for ftrace callbacks. This will detect if the function > * tracing recursed in the same context (normal vs interrupt), > * > * Returns: -1 if a recursion happened. > - * >= 0 if no recursion > + * >= 0 if no recursion (success) > + * > + * Disables the preemption on success. It is just for a convenience. > + * Current users needed to disable the preemtion for some reasons. > */ I started replying to this explaining the difference between bit not zero and a bit zero, and I think I found a design flaw that can allow unwanted recursion. It's late and I'm about to go to bed, but I may have a new patch to fix this before this gets added, as the fix will conflict with this patch, and the fix will likely need to go to stable. Stay tuned. -- Steve