Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3030954pxb; Tue, 12 Oct 2021 19:30:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/0yU7Iq/SAUsp4MCZlC2oVEOsn2aaWaciw27SaaWOZQd541vTZPwKR+Df1kydl4sZ6qCL X-Received: by 2002:a17:902:ecd0:b0:13f:1469:c0f2 with SMTP id a16-20020a170902ecd000b0013f1469c0f2mr27463889plh.10.1634092227697; Tue, 12 Oct 2021 19:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634092227; cv=none; d=google.com; s=arc-20160816; b=ZyZtrcAXZxySqbyS5iunFOZIkWK6qXWzC41/o18Ljp88nMwfjWh0TP4upnQDoTx6UW OjmKjitKkzkiQN1clMKw6/mYH4BQ4n5hXj+KUcrZ9qrQt7I2m3FJ67fj+XuX52NCw6W9 v4HJ854VgJUCXyUzJuU49gZ760CGcfjzYrMVW0LGh8OukJYECLVE9u9HC2mFUZu2f57n X/jmbg+oNLzI8IlfDflSe1xobo4FigtAWgfFFj6L8FBvmIN1QPO4FZHrDLitMQX3kEUt 7lLo2sm01K6Pp/hodJnmxsz9f3kP/V+nAKQ7oaA61U1iS+at9VhTgg+tFhjY4nTGhZim v1xQ== 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=U2cxzTdetRFFEtwEk4XXeYpunIGGOet6t0QGxIDQi+s=; b=r3A30+5xp8vR4oOCrPCauvllvNm3hR2jK3xxZ8ciPpGSczaemkcekEai/G7J0omEnN aDU245Mcxxe2dzIMhAbIz/pqvMgwkdkAsM7Zl4HmPz+XLf8wcQ1wrRMjKRe1NkIJ1diA tDKNQEL5nQb6PUezBu7YdWodCVvguIFZ0rHKk5EsZhMyLJC6HvHvbM1WQ/T6WEccuJKF CgBsieJsN+SqLW608rjdTNpsKP1k+HkT7Fxl2jKsLNKDf6INb5ClNgIRBZfY1GnvxclP uHdVRpkMb4A6x7eFZTcCdBu9phNNwHfU3swIZI2bj9zzyOATNfI7Gv4+4POVSF8+Ggsd upFA== 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 k37si3412490pgb.609.2021.10.12.19.30.14; Tue, 12 Oct 2021 19:30:27 -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 S235635AbhJMCaI convert rfc822-to-8bit (ORCPT + 99 others); Tue, 12 Oct 2021 22:30:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:43074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233316AbhJMCaH (ORCPT ); Tue, 12 Oct 2021 22:30:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17A2560F11; Wed, 13 Oct 2021 02:28:00 +0000 (UTC) Date: Tue, 12 Oct 2021 22:27:58 -0400 From: Steven Rostedt To: =?UTF-8?B?546L6LSH?= Cc: Miroslav Benes , 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 , 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: <20211012222758.1a029157@oasis.local.home> In-Reply-To: <74090798-7d93-0713-982c-6f0247118d20@linux.alibaba.com> References: <8c7de46d-9869-aa5e-2bb9-5dbc2eda395e@linux.alibaba.com> <74090798-7d93-0713-982c-6f0247118d20@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 09:50:17 +0800 王贇 wrote: > >> - preempt_enable_notrace(); > >> ftrace_test_recursion_unlock(bit); > >> } > > > > I don't like this change much. We have preempt_disable there not because > > of ftrace_test_recursion, but because of RCU. ftrace_test_recursion was > > added later. Yes, it would work with the change, but it would also hide > > things which should not be hidden in my opinion. > > Not very sure about the backgroup stories, but just found this in > 'Documentation/trace/ftrace-uses.rst': > > Note, on success, > ftrace_test_recursion_trylock() will disable preemption, and the > ftrace_test_recursion_unlock() will enable it again (if it was previously > enabled). Right that part is to be fixed by what you are adding here. The point that Miroslav is complaining about is that the preemption disabling is special in this case, and not just from the recursion point of view, which is why the comment is still required. -- Steve > > Seems like this lock pair was supposed to take care the preemtion itself?