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 27B2BC433EF for ; Tue, 12 Oct 2021 05:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06D3E610C9 for ; Tue, 12 Oct 2021 05:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232650AbhJLFnw (ORCPT ); Tue, 12 Oct 2021 01:43:52 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:38229 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbhJLFnv (ORCPT ); Tue, 12 Oct 2021 01:43:51 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R351e4;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_---0UrXyKWV_1634017303; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UrXyKWV_1634017303) by smtp.aliyun-inc.com(127.0.0.1); Tue, 12 Oct 2021 13:41:45 +0800 Subject: Re: [PATCH 0/2] ftrace: make sure preemption disabled on recursion testing From: =?UTF-8?B?546L6LSH?= To: 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 , 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 References: <8c7de46d-9869-aa5e-2bb9-5dbc2eda395e@linux.alibaba.com> Message-ID: Date: Tue, 12 Oct 2021 13:41:43 +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: <8c7de46d-9869-aa5e-2bb9-5dbc2eda395e@linux.alibaba.com> 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/12 δΈ‹εˆ1:39, ηŽ‹θ΄‡ wrote: > The testing show that perf_ftrace_function_call() are using > smp_processor_id() with preemption enabled, all the checking > on CPU could be wrong after preemption, PATCH 1/2 will fix > that. 2/2 actually. > > Besides, as Peter point out, the testing of recursion within > the section between ftrace_test_recursion_trylock()/_unlock() > pair also need the preemption disabled as the documentation > explained, PATCH 2/2 will make sure on that. 1/2 actually... Regards, Michael Wang > > Michael Wang (2): > ftrace: disable preemption on the testing of recursion > ftrace: prevent preemption in perf_ftrace_function_call() > > arch/csky/kernel/probes/ftrace.c | 2 -- > arch/parisc/kernel/ftrace.c | 2 -- > arch/powerpc/kernel/kprobes-ftrace.c | 2 -- > arch/riscv/kernel/probes/ftrace.c | 2 -- > arch/x86/kernel/kprobes/ftrace.c | 2 -- > include/linux/trace_recursion.h | 10 +++++++++- > kernel/livepatch/patch.c | 6 ------ > kernel/trace/trace_event_perf.c | 17 +++++++++++++---- > kernel/trace/trace_functions.c | 5 ----- > 9 files changed, 22 insertions(+), 26 deletions(-) > 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 4A6B1C433EF for ; Tue, 12 Oct 2021 05:42:10 +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 1522760EB6 for ; Tue, 12 Oct 2021 05:42:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1522760EB6 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:References:To:From:Subject:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZtESGGJP4R1QSSjlR8ySTZ1J7F+XHpe05WTP4ro59xY=; b=BtObdUaapoL4KkwdEaOB413kYf yNII9N+10fy6LKQ1gzmNU9PPVE64fa5PgZg9owwS1/jsOTgL/Q7mKnHwUv3N+6FcohA5FGUCieZPm gs30bkWTTqP7PZpgCQprG/064rfwZBSe7PUKU73Q4iON1BGTWGnidrGEvuzs0m9HMlk+OYSzG52yU VQVtGbgPVrUdfPOL1Ll2RPmYwfXv7O5Qpq8gRiBJU55An5ZzKqI/Aeic4lZa2Y0rRGjtaUVnfVfMm NfelgENVV7Z2rIR0W5MmKOLscCHzIcQxDJqsa7ArybDhyzf7vJTcHKT7w6PYABVEGSKNg6ps9b6hP scmfQXSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1maAXv-00Bdyq-4x; Tue, 12 Oct 2021 05:41:51 +0000 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1maAXs-00Bdxz-Nk for linux-riscv@lists.infradead.org; Tue, 12 Oct 2021 05:41:50 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R351e4; 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_---0UrXyKWV_1634017303; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0UrXyKWV_1634017303) by smtp.aliyun-inc.com(127.0.0.1); Tue, 12 Oct 2021 13:41:45 +0800 Subject: Re: [PATCH 0/2] ftrace: make sure preemption disabled on recursion testing From: =?UTF-8?B?546L6LSH?= To: 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 , 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 References: <8c7de46d-9869-aa5e-2bb9-5dbc2eda395e@linux.alibaba.com> Message-ID: Date: Tue, 12 Oct 2021 13:41:43 +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: <8c7de46d-9869-aa5e-2bb9-5dbc2eda395e@linux.alibaba.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_224148_963201_87BD3BF8 X-CRM114-Status: GOOD ( 11.45 ) 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 CgpPbiAyMDIxLzEwLzEyIOS4i+WNiDE6MzksIOeOi+i0hyB3cm90ZToKPiBUaGUgdGVzdGluZyBz aG93IHRoYXQgcGVyZl9mdHJhY2VfZnVuY3Rpb25fY2FsbCgpIGFyZSB1c2luZwo+IHNtcF9wcm9j ZXNzb3JfaWQoKSB3aXRoIHByZWVtcHRpb24gZW5hYmxlZCwgYWxsIHRoZSBjaGVja2luZwo+IG9u IENQVSBjb3VsZCBiZSB3cm9uZyBhZnRlciBwcmVlbXB0aW9uLCBQQVRDSCAxLzIgd2lsbCBmaXgK PiB0aGF0LgoKMi8yIGFjdHVhbGx5LgoKPiAKPiBCZXNpZGVzLCBhcyBQZXRlciBwb2ludCBvdXQs IHRoZSB0ZXN0aW5nIG9mIHJlY3Vyc2lvbiB3aXRoaW4KPiB0aGUgc2VjdGlvbiBiZXR3ZWVuIGZ0 cmFjZV90ZXN0X3JlY3Vyc2lvbl90cnlsb2NrKCkvX3VubG9jaygpCj4gcGFpciBhbHNvIG5lZWQg dGhlIHByZWVtcHRpb24gZGlzYWJsZWQgYXMgdGhlIGRvY3VtZW50YXRpb24KPiBleHBsYWluZWQs IFBBVENIIDIvMiB3aWxsIG1ha2Ugc3VyZSBvbiB0aGF0LgoKMS8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