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 E4820C4332F for ; Tue, 26 Oct 2021 02:52:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1CA7610A5 for ; Tue, 26 Oct 2021 02:52:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233859AbhJZCzM (ORCPT ); Mon, 25 Oct 2021 22:55:12 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:34834 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbhJZCzM (ORCPT ); Mon, 25 Oct 2021 22:55:12 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R691e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=31;SR=0;TI=SMTPD_---0Utj7nbU_1635216761; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0Utj7nbU_1635216761) by smtp.aliyun-inc.com(127.0.0.1); Tue, 26 Oct 2021 10:52:42 +0800 Subject: Re: [PATCH v4 0/2] fix & prevent the missing preemption disabling To: Steven Rostedt 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 References: <32a36348-69ee-6464-390c-3a8d6e9d2b53@linux.alibaba.com> <71c21f78-9c44-fdb2-f8e2-d8544b3421bd@linux.alibaba.com> <20211025224233.61b8e088@rorschach.local.home> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Tue, 26 Oct 2021 10:52:41 +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: <20211025224233.61b8e088@rorschach.local.home> 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/26 上午10:42, Steven Rostedt wrote: > On Tue, 26 Oct 2021 10:09:12 +0800 > 王贇 wrote: > >> Just a ping, to see if there are any more comments :-P > > I guess you missed what went into mainline (and your name found a bug > in my perl script for importing patches ;-) > > https://lore.kernel.org/all/20211019091344.65629198@gandalf.local.home/ Cool~ Missing some chinese font maybe, that's fine :-) > > Which means patch 1 needs to change: >> + /* >> + * Disable preemption to fulfill the promise. >> + * >> + * Don't worry about the bit 0 cases, they indicate >> + * the disabling behaviour has already been done by >> + * internal call previously. >> + */ >> + preempt_disable_notrace(); >> + >> return bit + 1; >> } >> >> +/* >> + * Preemption will be enabled (if it was previously enabled). >> + */ >> static __always_inline void trace_clear_recursion(int bit) >> { >> if (!bit) >> return; >> >> + if (bit > 0) >> + preempt_enable_notrace(); >> + > > Where this wont work anymore. > > Need to preempt disable and enable always. Yup, will rebase on the latest changes~ Regards, Michael Wang > > -- Steve > > >> barrier(); >> bit--; >> trace_recursion_clear(bit); >> @@ -209,7 +227,7 @@ static __always_inline void trace_clear_recursion(int bit) >> * tracing recursed in the same context (normal vs interrupt), >> * 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 C40EAC433EF for ; Tue, 26 Oct 2021 02:52:58 +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 67FAD6109D for ; Tue, 26 Oct 2021 02:52:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 67FAD6109D 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=sHr7S+tRDVP4xPKnUAQmt2gpY1BRROlHwxMpr33LGVg=; b=2NhbFfB0Vjmb5gmePXlSB/UUB8 U+3A2/uLQGSurJZ/t1Ne9kKK81luGCPpvHR9B10/CIWSEr9BECbLGNsrWeWpQTxEnGsnfgWPhpYVk iVgNRA7aOTxchUS1aqWkeR12AFEr3gg5s0Wuw6dzX6gq82sWJwgXnL+HnPQHpa4oQOUpbMuHq9bTH RUFOdKPG7852TdXDJNwwCJLYN4pV1kktaetXZ/WV6O9hRZFvNbIPBfmI0GzTwq1ZJzRnHtj7pKEWg 0i78DbsUOLEXfiiVSDzicUd3liQda9uy0Qc0mOxME5cuTFzDuh4vj9A+lx8Asf+fwTS/Wh9Yy5VMG dT8NA4+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfCa4-000VMG-3E; Tue, 26 Oct 2021 02:52:52 +0000 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfCa0-000VL0-HH for linux-riscv@lists.infradead.org; Tue, 26 Oct 2021 02:52:50 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R691e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04426; MF=yun.wang@linux.alibaba.com; NM=1; PH=DS; RN=31; SR=0; TI=SMTPD_---0Utj7nbU_1635216761; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0Utj7nbU_1635216761) by smtp.aliyun-inc.com(127.0.0.1); Tue, 26 Oct 2021 10:52:42 +0800 Subject: Re: [PATCH v4 0/2] fix & prevent the missing preemption disabling To: Steven Rostedt 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 References: <32a36348-69ee-6464-390c-3a8d6e9d2b53@linux.alibaba.com> <71c21f78-9c44-fdb2-f8e2-d8544b3421bd@linux.alibaba.com> <20211025224233.61b8e088@rorschach.local.home> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Tue, 26 Oct 2021 10:52:41 +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: <20211025224233.61b8e088@rorschach.local.home> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_195248_771180_76BCC717 X-CRM114-Status: GOOD ( 16.80 ) 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 CgpPbiAyMDIxLzEwLzI2IOS4iuWNiDEwOjQyLCBTdGV2ZW4gUm9zdGVkdCB3cm90ZToKPiBPbiBU dWUsIDI2IE9jdCAyMDIxIDEwOjA5OjEyICswODAwCj4g546L6LSHIDx5dW4ud2FuZ0BsaW51eC5h bGliYWJhLmNvbT4gd3JvdGU6Cj4gCj4+IEp1c3QgYSBwaW5nLCB0byBzZWUgaWYgdGhlcmUgYXJl IGFueSBtb3JlIGNvbW1lbnRzIDotUAo+IAo+IEkgZ3Vlc3MgeW91IG1pc3NlZCB3aGF0IHdlbnQg aW50byBtYWlubGluZSAoYW5kIHlvdXIgbmFtZSBmb3VuZCBhIGJ1Zwo+IGluIG15IHBlcmwgc2Ny aXB0IGZvciBpbXBvcnRpbmcgcGF0Y2hlcyA7LSkKPiAKPiAgIGh0dHBzOi8vbG9yZS5rZXJuZWwu b3JnL2FsbC8yMDIxMTAxOTA5MTM0NC42NTYyOTE5OEBnYW5kYWxmLmxvY2FsLmhvbWUvCgpDb29s fiBNaXNzaW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cigpOwo+PiAgCWJpdC0tOwo+PiAgCXRyYWNlX3JlY3Vyc2lvbl9jbGVhcihiaXQpOwo+PiBA QCAtMjA5LDcgKzIyNyw3IEBAIHN0YXRpYyBfX2Fsd2F5c19pbmxpbmUgdm9pZCB0cmFjZV9jbGVh cl9yZWN1cnNpb24oaW50IGJpdCkKPj4gICAqIHRyYWNpbmcgcmVjdXJzZWQgaW4gdGhlIHNhbWUg Y29udGV4dCAobm9ybWFsIHZzIGludGVycnVwdCksCj4+ICAgKgoKX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGludXgtcmlzY3YgbWFpbGluZyBsaXN0Cmxp bnV4LXJpc2N2QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcv bWFpbG1hbi9saXN0aW5mby9saW51eC1yaXNjdgo= 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 B9C02C433F5 for ; Tue, 26 Oct 2021 02:53:35 +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 09D6B6109D for ; Tue, 26 Oct 2021 02:53:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 09D6B6109D 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 4Hdbx945kMz30HR for ; Tue, 26 Oct 2021 13:53:33 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.133; helo=out30-133.freemail.mail.aliyun.com; envelope-from=yun.wang@linux.alibaba.com; receiver=) Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) (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 4Hdbwc4LwCz2xvf for ; Tue, 26 Oct 2021 13:53:01 +1100 (AEDT) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R691e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04426; MF=yun.wang@linux.alibaba.com; NM=1; PH=DS; RN=31; SR=0; TI=SMTPD_---0Utj7nbU_1635216761; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0Utj7nbU_1635216761) by smtp.aliyun-inc.com(127.0.0.1); Tue, 26 Oct 2021 10:52:42 +0800 Subject: Re: [PATCH v4 0/2] fix & prevent the missing preemption disabling To: Steven Rostedt References: <32a36348-69ee-6464-390c-3a8d6e9d2b53@linux.alibaba.com> <71c21f78-9c44-fdb2-f8e2-d8544b3421bd@linux.alibaba.com> <20211025224233.61b8e088@rorschach.local.home> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Tue, 26 Oct 2021 10:52:41 +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: <20211025224233.61b8e088@rorschach.local.home> 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, Miroslav Benes , Paul Mackerras , Joe Lawrence , Helge Deller , x86@kernel.org, linux-csky@vger.kernel.org, Ingo Molnar , Petr Mladek , Albert Ou , Jiri Kosina , Nicholas Piggin , Borislav Petkov , 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/26 上午10:42, Steven Rostedt wrote: > On Tue, 26 Oct 2021 10:09:12 +0800 > 王贇 wrote: > >> Just a ping, to see if there are any more comments :-P > > I guess you missed what went into mainline (and your name found a bug > in my perl script for importing patches ;-) > > https://lore.kernel.org/all/20211019091344.65629198@gandalf.local.home/ Cool~ Missing some chinese font maybe, that's fine :-) > > Which means patch 1 needs to change: >> + /* >> + * Disable preemption to fulfill the promise. >> + * >> + * Don't worry about the bit 0 cases, they indicate >> + * the disabling behaviour has already been done by >> + * internal call previously. >> + */ >> + preempt_disable_notrace(); >> + >> return bit + 1; >> } >> >> +/* >> + * Preemption will be enabled (if it was previously enabled). >> + */ >> static __always_inline void trace_clear_recursion(int bit) >> { >> if (!bit) >> return; >> >> + if (bit > 0) >> + preempt_enable_notrace(); >> + > > Where this wont work anymore. > > Need to preempt disable and enable always. Yup, will rebase on the latest changes~ Regards, Michael Wang > > -- Steve > > >> barrier(); >> bit--; >> trace_recursion_clear(bit); >> @@ -209,7 +227,7 @@ static __always_inline void trace_clear_recursion(int bit) >> * tracing recursed in the same context (normal vs interrupt), >> *