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 C7B29C433EF for ; Wed, 13 Oct 2021 08:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A751B60FDA for ; Wed, 13 Oct 2021 08:11:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238848AbhJMINW (ORCPT ); Wed, 13 Oct 2021 04:13:22 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:46211 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238736AbhJMINV (ORCPT ); Wed, 13 Oct 2021 04:13:21 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R641e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=31;SR=0;TI=SMTPD_---0UrfoBuS_1634112670; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UrfoBuS_1634112670) by smtp.aliyun-inc.com(127.0.0.1); Wed, 13 Oct 2021 16:11:12 +0800 Subject: Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock() To: Miroslav Benes Cc: Guo Ren , Steven Rostedt , 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 References: <75ee86ac-02f2-d687-ab1e-9c8c33032495@linux.alibaba.com> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Wed, 13 Oct 2021 16:11:10 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On 2021/10/13 下午3:55, Miroslav Benes wrote: >> diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h >> index a9f9c57..101e1fb 100644 >> --- a/include/linux/trace_recursion.h >> +++ b/include/linux/trace_recursion.h >> @@ -208,13 +208,29 @@ static __always_inline void trace_clear_recursion(int bit) >> * Use this for ftrace callbacks. This will detect if the function >> * tracing recursed in the same context (normal vs interrupt), >> * >> + * The ftrace_test_recursion_trylock() will disable preemption, >> + * which is required for the variant of synchronize_rcu() that is >> + * used to allow patching functions where RCU is not watching. >> + * See klp_synchronize_transition() for more details. >> + * > > I think that you misunderstood. Steven proposed to put the comment before > ftrace_test_recursion_trylock() call site in klp_ftrace_handler(). Oh, I see... thanks for pointing out :-) > >> * Returns: -1 if a recursion happened. [snip] >> } > > Side note... the comment will eventually conflict with peterz's > https://lore.kernel.org/all/20210929152429.125997206@infradead.org/. Steven, would you like to share your opinion on this patch? If klp_synchronize_transition() will be removed anyway, the comments will be meaningless and we can just drop it :-P Regards, Michael Wang > > Miroslav > 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 C6752C433EF for ; Wed, 13 Oct 2021 08:11:52 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A865360FDA for ; Wed, 13 Oct 2021 08:11:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A865360FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HTlcP6LRLz3c5B for ; Wed, 13 Oct 2021 19:11:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.130; helo=out30-130.freemail.mail.aliyun.com; envelope-from=yun.wang@linux.alibaba.com; receiver=) Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HTlbx0L9hz2xXK for ; Wed, 13 Oct 2021 19:11:22 +1100 (AEDT) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R641e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=yun.wang@linux.alibaba.com; NM=1; PH=DS; RN=31; SR=0; TI=SMTPD_---0UrfoBuS_1634112670; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UrfoBuS_1634112670) by smtp.aliyun-inc.com(127.0.0.1); Wed, 13 Oct 2021 16:11:12 +0800 Subject: Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock() To: Miroslav Benes References: <75ee86ac-02f2-d687-ab1e-9c8c33032495@linux.alibaba.com> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Wed, 13 Oct 2021 16:11:10 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Peter Zijlstra \(Intel\)" , Paul Walmsley , "James E.J. Bottomley" , Guo Ren , Jisheng Zhang , "H. Peter Anvin" , live-patching@vger.kernel.org, linux-riscv@lists.infradead.org, Paul Mackerras , Joe Lawrence , Helge Deller , x86@kernel.org, linux-csky@vger.kernel.org, Ingo Molnar , Petr Mladek , Albert Ou , Jiri Kosina , Steven Rostedt , Borislav Petkov , Nicholas Piggin , Josh Poimboeuf , Thomas Gleixner , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Masami Hiramatsu , Colin Ian King , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 2021/10/13 下午3:55, Miroslav Benes wrote: >> diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h >> index a9f9c57..101e1fb 100644 >> --- a/include/linux/trace_recursion.h >> +++ b/include/linux/trace_recursion.h >> @@ -208,13 +208,29 @@ static __always_inline void trace_clear_recursion(int bit) >> * Use this for ftrace callbacks. This will detect if the function >> * tracing recursed in the same context (normal vs interrupt), >> * >> + * The ftrace_test_recursion_trylock() will disable preemption, >> + * which is required for the variant of synchronize_rcu() that is >> + * used to allow patching functions where RCU is not watching. >> + * See klp_synchronize_transition() for more details. >> + * > > I think that you misunderstood. Steven proposed to put the comment before > ftrace_test_recursion_trylock() call site in klp_ftrace_handler(). Oh, I see... thanks for pointing out :-) > >> * Returns: -1 if a recursion happened. [snip] >> } > > Side note... the comment will eventually conflict with peterz's > https://lore.kernel.org/all/20210929152429.125997206@infradead.org/. Steven, would you like to share your opinion on this patch? If klp_synchronize_transition() will be removed anyway, the comments will be meaningless and we can just drop it :-P Regards, Michael Wang > > Miroslav > 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 2E445C433F5 for ; Wed, 13 Oct 2021 09:58:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB88560E74 for ; Wed, 13 Oct 2021 09:58:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB88560E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Y1cYw0VKsHL2IztmquUtDcC++p1avLs3kEqNRNbJO50=; b=loNfg0INUg1JXZzTSxsNeMTrpi ms4P0SBSk19JqeoJsKQXz4N6nAMfbANOXAGlT8Mba81SglN/Y9C35984mf9nkYGYOZQxFpm0uC/4T Be++ds77DHDiqCMtNwxJAfeC/z8F+82MQ6w7w0df2YspZMLPgJEZWOwmo/snFIjIzXNaKix/173dY Xi8vMpunSI2PW9hRgXLPE8yPODwlkaAr/wd8qQkc7EJmywrSlCByscqOHsmLNMENQnJ6m27/S/foG ydvSqiBk7VV2BoOISIsJ2Jo6VtxEfbea48OtYI/tFsjNeDRqKfDyEnZfkmj8wgGIeCCrJ4M3B0uzJ XPiEXPBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mab19-00Frcj-9p; Wed, 13 Oct 2021 09:57:47 +0000 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1maZM8-00FVmx-Go for linux-riscv@lists.infradead.org; Wed, 13 Oct 2021 08:11:22 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R641e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=yun.wang@linux.alibaba.com; NM=1; PH=DS; RN=31; SR=0; TI=SMTPD_---0UrfoBuS_1634112670; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UrfoBuS_1634112670) by smtp.aliyun-inc.com(127.0.0.1); Wed, 13 Oct 2021 16:11:12 +0800 Subject: Re: [RESEND PATCH v2 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock() To: Miroslav Benes Cc: Guo Ren , Steven Rostedt , 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 References: <75ee86ac-02f2-d687-ab1e-9c8c33032495@linux.alibaba.com> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Wed, 13 Oct 2021 16:11:10 +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: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211013_011120_816477_BEC44202 X-CRM114-Status: GOOD ( 12.74 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org CgpPbiAyMDIxLzEwLzEzIOS4i+WNiDM6NTUsIE1pcm9zbGF2IEJlbmVzIHdyb3RlOgo+PiBkaWZm IC0tZ2l0IGEvaW5jbHVkZS9saW51eC90cmFjZV9yZWN1cnNpb24uaCBiL2luY2x1ZGUvbGludXgv dHJhY2VfcmVjdXJzaW9uLmgKPj4gaW5kZXggYTlmOWM1Ny4uMTAxZTFmYiAxMDA2NDQKPj4gLS0t IGEvaW5jbHVkZS9saW51eC90cmFjZV9yZWN1cnNpb24uaAo+PiArKysgYi9pbmNsdWRlL2xpbnV4 L3RyYW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