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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B26AC25B0F for ; Sat, 30 Jul 2022 19:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235756AbiG3Twx (ORCPT ); Sat, 30 Jul 2022 15:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbiG3Tws (ORCPT ); Sat, 30 Jul 2022 15:52:48 -0400 Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0127E13F39; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id n8so13219366yba.2; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0QwwjVOIVs4sR9ljVmsJX6Xu2S4+tvcr+oBVAjM+ePA=; b=e8a+uAA9tupGiL3yo8EkLFat/Yo8hfOL0dEjkN03EunifrpH5WDt1ik8Q1l2EEocjT fVLKUVbPQ9p/jM9rZc9eF9zc1WhebYD91WFyUJRwIVfjf9eCUMB2ZXT2bKXo1vYd8xMc 50i0dubF4/84MjJhKF4f85UL/b1J0h+2706rL4zlKw4tJHsRIFOrc5kAycR6TXvyhJ9j CllXK+t+T+a1NuZN8RfaIE0i+YPlr+Ffb4JjIxKgdpkG9WV3WEADKavvYeM3AYhjh8Iu gcsyrORxqg7xbZQpjRPJZ9seachiStWce2u60xdb874MBo8w5IRxW8i7Qr+4fXWv/6+q E64w== X-Gm-Message-State: ACgBeo3OxYk4mfg72HXbMBbEY4LajVRBqucZ4mdHqCYye8RS04nh7S16 hmWROudYRZmXM0tYeJDe4uYZSSldbIvoGgz0A8I= X-Google-Smtp-Source: AA6agR5p+lnEO42NEIBehm6hZLFrmXewKv2ogwUWOYz3LvGYShyipeAc9YxoFpIxLibrvw9Jcl6WeqKY+cLq4G0/mNE= X-Received: by 2002:a25:3458:0:b0:673:5bca:3b45 with SMTP id b85-20020a253458000000b006735bca3b45mr6304433yba.633.1659210766011; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE To: Michel Lespinasse Cc: "Rafael J. Wysocki" , "Paul E. McKenney" , Peter Zijlstra , Richard Henderson , Ivan Kokshaysky , Matt Turner , vgupta@kernel.org, Russell King - ARM Linux , ulli.kroll@googlemail.com, Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , dl-linux-imx , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , kernel@xen0n.name, Geert Uytterhoeven , sammy@sammy.net, Michal Simek , Thomas Bogendoerfer , dinguyen@kernel.org, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , anton.ivanov@cambridgegreys.com, Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , acme@kernel.org, Mark Rutland , Alexander Shishkin , jolsa@kernel.org, namhyung@kernel.org, Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, pv-drivers@vmware.com, Boris Ostrovsky , Chris Zankel , Max Filippov , Len Brown , Pavel Machek , Greg Kroah-Hartman , Michael Turquette , Stephen Boyd , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jon Hunter , Jacob Pan , Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , senozhatsky@chromium.org, John Ogness , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, linux-alpha@vger.kernel.org, Linux Kernel Mailing List , linux-snps-arc@lists.infradead.org, Linux ARM , Linux OMAP Mailing List , linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k , "open list:BROADCOM NVRAM DRIVER" , openrisc@lists.librecores.org, Parisc List , linuxppc-dev , linux-riscv , linux-s390@vger.kernel.org, Linux-sh list , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-perf-users@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-xtensa@linux-xtensa.org, ACPI Devel Maling List , Linux PM , linux-clk , linux-arm-msm , linux-tegra , linux-arch , rcu@vger.kernel.org, rh0@fb.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19. 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 88418C19F2B for ; Sat, 30 Jul 2022 19:52:58 +0000 (UTC) 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yYhRx/U2+4ZBLPQu4EDQQDMz0VVafptGTNONUubaeH0=; b=apLsWhpNLK8hnR Vi9UtqGf8kjR1+EcALAxE2yUaipsd0l74n+1gxdv8P0Tn3BMcqN6ztW+MiR+Q+4Bxaep2Foz0cMlH yKexI+fU9ZL5Y0gc2iOsxzdUQDFKfTF3vJjHlMskHZhOWgSxzChab7FG+lxNXcoy0ZiLTNDplYxwT JMoX9OYISm3Q4bfFRc8kAAxqXFiLP1a8jY/lZ+2vm5x07TTH50IO7FPtVv4yUguv7wbh2JljkCpx6 xkTICxJG8CcGIMir21ifb8fJle/y48kF44UWiZ85NrJo9PT/0QrLV2T+8r/krDZWV4IZHYTTiBMHO x2KSPO4hGjfh3hVD0mJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oHsW6-003v95-Sd; Sat, 30 Jul 2022 19:52:54 +0000 Received: from mail-yb1-f170.google.com ([209.85.219.170]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oHsW2-003v2b-HW; Sat, 30 Jul 2022 19:52:52 +0000 Received: by mail-yb1-f170.google.com with SMTP id r3so13188946ybr.6; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0QwwjVOIVs4sR9ljVmsJX6Xu2S4+tvcr+oBVAjM+ePA=; b=ZSLiu1VDdrxC/pSQbsxPUapEhDJm4uRZ8LgKZlM3UzhBn2wy+Nj9fq4OMmH0d70OdO oNj9F+76OgtgZq1UtaElxN/OCzp13N6rnjJ+hVP97Az1yDMhBjkwtQV1gm6TEwa9Ecui IiBbXqXrswbXLlAyTidvITbY+AlEbFjCLG/BzQ2KIvkuRonJrDQO2Uh1ZWI1Ngh7Vn98 q+OHwoMZwlYM2IG2Ks4l5zflmU1wZYsNNjySfxkanXHM7NngKmxfKPSGF9tJFHT6pETU TGosdQBzpdFxmSm76kmQSrDKc3bHF/F+CX5FwBQ1S5Pp1qlAfF6C6v/Eq4ZPRFmXfjwW 5Nxg== X-Gm-Message-State: ACgBeo1yKLuzYGEd214LtDJFohZsF49jkz0kRgo9SoCDx4UWQfNN3FxV N0Cc/SF/3E/AVyH5A0PhW5rustqz6gyjwR9CP+U= X-Google-Smtp-Source: AA6agR5p+lnEO42NEIBehm6hZLFrmXewKv2ogwUWOYz3LvGYShyipeAc9YxoFpIxLibrvw9Jcl6WeqKY+cLq4G0/mNE= X-Received: by 2002:a25:3458:0:b0:673:5bca:3b45 with SMTP id b85-20020a253458000000b006735bca3b45mr6304433yba.633.1659210766011; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE To: Michel Lespinasse Cc: "Rafael J. Wysocki" , "Paul E. McKenney" , Peter Zijlstra , Richard Henderson , Ivan Kokshaysky , Matt Turner , vgupta@kernel.org, Russell King - ARM Linux , ulli.kroll@googlemail.com, Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , dl-linux-imx , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , kernel@xen0n.name, Geert Uytterhoeven , sammy@sammy.net, Michal Simek , Thomas Bogendoerfer , dinguyen@kernel.org, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , anton.ivanov@cambridgegreys.com, Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , acme@kernel.org, Mark Rutland , Alexander Shishkin , jolsa@kernel.org, namhyung@kernel.org, Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, pv-drivers@vmware.com, Boris Ostrovsky , Chris Zankel , Max Filippov , Len Brown , Pavel Machek , Greg Kroah-Hartman , Michael Turquette , Stephen Boyd , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jon Hunter , Jacob Pan , Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , senozhatsky@chromium.org, John Ogness , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, linux-alpha@vger.kernel.org, Linux Kernel Mailing List , linux-snps-arc@lists.infradead.org, Linux ARM , Linux OMAP Mailing List , linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k , "open list:BROADCOM NVRAM DRIVER" , openrisc@lists.librecores.org, Parisc List , linuxppc-dev , linux-riscv , linux-s390@vger.kernel.org, Linux-sh list , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-perf-users@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-xtensa@linux-xtensa.org, ACPI Devel Maling List , Linux PM , linux-clk , linux-arm-msm , linux-tegra , linux-arch , rcu@vger.kernel.org, rh0@fb.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220730_125250_607938_0DCEE593 X-CRM114-Status: GOOD ( 50.24 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19. _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A0B1C25B08 for ; Sat, 30 Jul 2022 19:52:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 00E8741817; Sat, 30 Jul 2022 19:52:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 00E8741817 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FzQvM1EgStUA; Sat, 30 Jul 2022 19:52:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id BDED64156D; Sat, 30 Jul 2022 19:52:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BDED64156D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 61EC5C0033; Sat, 30 Jul 2022 19:52:50 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 934D1C002D for ; Sat, 30 Jul 2022 19:52:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5C1D860E3D for ; Sat, 30 Jul 2022 19:52:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5C1D860E3D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gqQGd8Gc1Qnz for ; Sat, 30 Jul 2022 19:52:47 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 272CF60E13 Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) by smtp3.osuosl.org (Postfix) with ESMTPS id 272CF60E13 for ; Sat, 30 Jul 2022 19:52:47 +0000 (UTC) Received: by mail-yb1-f175.google.com with SMTP id j63so13121886ybb.13 for ; Sat, 30 Jul 2022 12:52:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0QwwjVOIVs4sR9ljVmsJX6Xu2S4+tvcr+oBVAjM+ePA=; b=NMe4GY/eNlIKXwal0uDMZFvws/bzXVGldGG1sFfep6bTW3rBwb8m+CJ6MVz19LvLaD LGTwCF8J9gz1dGCa6OBdli1vGJkfeIk562yIMau7sozXXiqfLbYLWU4g233UpBdwy6MF fyaNyU7GOboTPb9RjIcJtWLEPk9OwFtwuupQHkZRNr+gjriWNFEaO5/TL+xAFJgZ9xc9 5FIeY26gafMoSI59AUFJ1lsiSFpa/73Qu+9JiNCUHJ4VapnEJUTR+zMeAAuFEdOmY3hU Wt2gLuxsYhjHyWkP7/nFBb90oPi9+COJ2zIBMcQBfEg1PDBoG6auFl6Dx7C4wwthr5Wd OXMA== X-Gm-Message-State: ACgBeo14sjOHJNT5mkbhDqQKV4ESEe444WvzDjf/MS48X+k+Dm4G29RW B0NYagTUdrSaFOV4gVjmboXsyiRh1HYXGfY86c4= X-Google-Smtp-Source: AA6agR5p+lnEO42NEIBehm6hZLFrmXewKv2ogwUWOYz3LvGYShyipeAc9YxoFpIxLibrvw9Jcl6WeqKY+cLq4G0/mNE= X-Received: by 2002:a25:3458:0:b0:673:5bca:3b45 with SMTP id b85-20020a253458000000b006735bca3b45mr6304433yba.633.1659210766011; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE To: Michel Lespinasse Cc: Juri Lelli , "Rafael J. Wysocki" , Benjamin Herrenschmidt , Linus Walleij , Benjamin Segall , Guo Ren , Pavel Machek , Alexander Gordeev , linux-arch , Vincent Guittot , Michael Ellerman , Huacai Chen , ACPI Devel Maling List , Andy Gross , Geert Uytterhoeven , dl-linux-imx , Catalin Marinas , xen-devel@lists.xenproject.org, Matt Turner , Michael Turquette , sammy@sammy.net, Petr Mladek , Linux PM , Lai Jiangshan , Sascha Hauer , linux-um@lists.infradead.org, acme@kernel.org, Thomas Gleixner , Linux OMAP Mailing List , Dietmar Eggemann , Richard Henderson , Greg Kroah-Hartman , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, senozhatsky@chromium.org, Sven Schnelle , jolsa@kernel.org, Paul Mackerras , Mark Rutland , linux-ia64@vger.kernel.org, Dave Hansen , virtualization@lists.linux-foundation.org, James Bottomley , Max Filippov , Thierry Reding , kernel@xen0n.name, quic_neeraju@quicinc.com, linux-s390@vger.kernel.org, vschneid@redhat.com, John Ogness , Yoshinori Sato , Linux-sh list , Will Deacon , Helge Deller , Daniel Lezcano , Jon Hunter , Mathieu Desnoyers , Frederic Weisbecker , Len Brown , linux-xtensa@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-alpha@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , rh0@fb.com, dinguyen@kernel.org, Daniel Bristot de Oliveira , Alexander Shishkin , Lorenzo Pieralisi , Rasmus Villemoes , Joel Fernandes , Fabio Estevam , Boris Ostrovsky , Josh Triplett , Kevin Hilman , linux-csky@vger.kernel.org, Tony Lindgren , linux-snps-arc@lists.infradead.org, Mel Gorman , Jacob Pan , Yury Norov , ulli.kroll@googlemail.com, vgupta@kernel.org, linux-clk , Michal Simek , Steven Rostedt , rcu@vger.kernel.org, Borislav Petkov , bcain@quicinc.com, Thomas Bogendoerfer , Parisc List , Sudeep Holla , Shawn Guo , David Miller , Rich Felker , Peter Zijlstra , amakhalov@vmware.com, Bjorn Andersson , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-riscv , anton.ivanov@cambridgegreys.com, jonas@southpole.se, Arnd Bergmann , Richard Weinberger , the arch/x86 maintainers , Russell King - ARM Linux , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Heiko Carstens , stefan.kristiansson@saunalahti.fi, openrisc@lists.librecores.org, Paul Walmsley , linux-tegra , namhyung@kernel.org, Andy Shevchenko , jpoimboe@kernel.org, Juergen Gross , pv-drivers@vmware.com, "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , Anup Patel , Ivan Kokshaysky , Johannes Berg , linuxppc-dev X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19. _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 983E2C19F2A for ; Sat, 30 Jul 2022 21:18:34 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LwHLK12Q0z3blw for ; Sun, 31 Jul 2022 07:18:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.219.174; helo=mail-yb1-f174.google.com; envelope-from=rjwysocki@gmail.com; receiver=) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (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 4LwFRS4m5tz2xGy for ; Sun, 31 Jul 2022 05:52:50 +1000 (AEST) Received: by mail-yb1-f174.google.com with SMTP id 123so13182046ybv.7 for ; Sat, 30 Jul 2022 12:52:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0QwwjVOIVs4sR9ljVmsJX6Xu2S4+tvcr+oBVAjM+ePA=; b=aOJwH/sN/FBDJ2ITjUz+Vsg1Uf2pyqZfVWwi6lUmVBtU+M+4TSJJijdvcNNyaINTsu Ci8j0fYdzWNOQ+25sloLtDVVP9vbzaf1yEat3IjtgVczQM3vZMG1gQmpz4dvjKlxkzlC OGg8PClRryErfJEOt1DVj0LYJoNGJtp/RjEAupLgv28jRJFyLApCDtOy0EiaQw5Z2cLQ uqlHR1xxzKAZjzGqFxtRCLrNAqWKT0uUjkIaBzXWSKkpMgOjvPFlcPXXkMBQSVgFDlOf AKsGNQ7Zl6RrFcJ0R4TufI6eIoTbPikPgKM7FHLsowor9e8/ZoTF5eKn0RTMOOcEwwFj 2SsA== X-Gm-Message-State: ACgBeo3IgkJlYhQSKEWpFIYBQ0uCvAYhqfDaPKl/U+/wZERiL47pOivz sudRnTpack16Q9+uSCnUZ4mViNb36qAA+TySPys= X-Google-Smtp-Source: AA6agR5p+lnEO42NEIBehm6hZLFrmXewKv2ogwUWOYz3LvGYShyipeAc9YxoFpIxLibrvw9Jcl6WeqKY+cLq4G0/mNE= X-Received: by 2002:a25:3458:0:b0:673:5bca:3b45 with SMTP id b85-20020a253458000000b006735bca3b45mr6304433yba.633.1659210766011; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE To: Michel Lespinasse Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Sun, 31 Jul 2022 07:17:36 +1000 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: Juri Lelli , "Rafael J. Wysocki" , Linus Walleij , Benjamin Segall , Guo Ren , Pavel Machek , Alexander Gordeev , srivatsa@csail.mit.edu, linux-arch , Vincent Guittot , Huacai Chen , ACPI Devel Maling List , Andy Gross , Geert Uytterhoeven , dl-linux-imx , Catalin Marinas , xen-devel@lists.xenproject.org, Matt Turner , Christian Borntraeger , Michael Turquette , sammy@sammy.net, Petr Mladek , Linux PM , Lai Jiangshan , Sascha Hauer , linux-um@lists.infradead.org, acme@kernel.org, Thomas G leixner , Linux OMAP Mailing List , Dietmar Eggemann , Richard Henderson , Greg Kroah-Hartman , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, senozhatsky@chromium.org, Sven Schnelle , jolsa@kernel.org, Paul Mackerras , Mark Rutland , linux-ia64@vger.kernel.org, Dave Hansen , virtualization@lists.linux-foundation.org, James Bottomley , Max Filippov , Thierry Reding , kernel@xen0n.name, quic_neeraju@quicinc.com, linux-s390@vger.kernel.org, vschneid@redhat.com, John Ogness , Yoshinori Sato , Linux-sh list , Will Deacon , Helge Deller , Danie l Lezcano , Jon Hunter , Mathieu Desnoyers , Frederic Weisbecker , Len Brown , linux-xtensa@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-alpha@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , rh0@fb.com, dinguyen@kernel.org, Daniel Bristot de Oliveira , Alexander Shishkin , Lorenzo Pieralisi , Rasmus Villemoes , Joel Fernandes , Fabio Estevam , Boris Ostrovsky , Josh Triplett , Kevin Hilman , linux-csky@vger.kernel.org, Tony Lindgren , linux-snps-arc@lists.infradead.org, Mel Gorman , Jacob Pan , Yury Norov , ulli.kroll@googlemail.com, vgupta@kernel.org, linux-clk , Michal Simek , Steven Rostedt , rcu@vger.kernel.org, Borislav Petkov , bcain@quicinc.com, Thomas Bogendoerfer , Parisc List , Sudeep Holla , Shawn Guo , David Miller , Rich Felker , Peter Zijlstra , amakhalov@vmware.com, Bjorn Andersson , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-riscv , anton.ivanov@cambridgegreys.com, jonas@southpole.se, Arnd Bergmann , Richard Weinberger , the arch/x86 maintainers , Russell King - ARM Linux , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Heiko Carstens , stefan.kristiansson@saunalahti.fi, openrisc@lists.librecores.org, Paul Walmsley , linux-tegra , namhyung@kernel.org, Andy Shevchenko , jpoimboe@kernel.org, Juergen Gross , pv-drivers@vmware.com, "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , Anup Patel , Ivan Kokshaysky , Johannes Berg , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19. 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.librecores.org (lists.librecores.org [88.198.125.70]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CEDCC25B0F for ; Sun, 31 Jul 2022 22:07:44 +0000 (UTC) Received: from [172.31.1.100] (localhost.localdomain [127.0.0.1]) by mail.librecores.org (Postfix) with ESMTP id 2BCDD24840; Mon, 1 Aug 2022 00:07:44 +0200 (CEST) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by mail.librecores.org (Postfix) with ESMTPS id 32A7D240E1 for ; Sat, 30 Jul 2022 21:52:47 +0200 (CEST) Received: by mail-yb1-f182.google.com with SMTP id j63so13121885ybb.13 for ; Sat, 30 Jul 2022 12:52:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0QwwjVOIVs4sR9ljVmsJX6Xu2S4+tvcr+oBVAjM+ePA=; b=McLXIWtTDmUlBhURfdgg9ZDeriLqZ3K6wtmhCTK0emPjgrpYUFNnE4zmWsz22Xza3T tcFhghVeFqEmP2FUN7B/1vl1C1dNtDGicOtF4PbcI0weA2abX6Ioi//a7Szj0ht+1ZWk BsdSkMYn07DlDZ6n0UGj6VVdPdb+D93z1ogWmIb6HpjIpxYMRzPXEERDG7GkuawbNGEZ 57VbCSgl/iaheVMzi+Y82+rCVdZOg5wkHCjVxgR/4f3p3aDNwTPLDfK3jfYLTF7iJ76b Vvb0Chh4JxhBDxwH9qVNkocuCLEyOVQtK8a6Fb+5i7t8385TmQsJuJvpSCj/oUhB8Wwq sHgA== X-Gm-Message-State: ACgBeo00bYVJRoYuVMOqxPsKlhBpIuFCnFOjTB7M/DT7IGKTiU+Udket 4mlo1I2o7QAPng3yXHCecMQXsdLj+3NZOn9P0WA= X-Google-Smtp-Source: AA6agR5p+lnEO42NEIBehm6hZLFrmXewKv2ogwUWOYz3LvGYShyipeAc9YxoFpIxLibrvw9Jcl6WeqKY+cLq4G0/mNE= X-Received: by 2002:a25:3458:0:b0:673:5bca:3b45 with SMTP id b85-20020a253458000000b006735bca3b45mr6304433yba.633.1659210766011; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE To: Michel Lespinasse Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Mon, 01 Aug 2022 00:07:35 +0200 X-BeenThere: openrisc@lists.librecores.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion around the OpenRISC processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , "Rafael J. Wysocki" , Benjamin Herrenschmidt , Linus Walleij , Benjamin Segall , Guo Ren , Pavel Machek , Alexander Gordeev , srivatsa@csail.mit.edu, linux-arch , Vincent Guittot , Michael Ellerman , Huacai Chen , ACPI Devel Maling List , Andy Gross , dl-linux-imx , Catalin Marinas , xen-devel@lists.xenproject.org, Matt Turner , Christian Borntraeger , Michael Turquette , sammy@sammy.net, Petr Mladek , Linux PM , Lai Jiangshan , Sascha Hauer , linux-um@lists.infradead.org, acme@kernel.org, Thomas Gleixner , Linux OMAP Mailing List , Dietmar Eggemann , Richard Henderson , Greg Kroah-Hartman , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, senozhatsky@chromium.org, Sven Schnelle , jolsa@kernel.org, Paul Mackerras , Mark Rutland , linux-ia64@vger.kernel.org, Dave Hansen , virtualization@lists.linux-foundation.org, James Bottomley , Max Filippov , Thierry Reding , kernel@xen0n.name, quic_neeraju@quicinc.com, linux-s390@vger.kernel.org, vschneid@redhat.com, John Ogness , Yoshinori Sato , Linux-sh list , Will Deacon , Helge Deller , Daniel Lezcano , Jon Hunter , Mathieu Desnoyers , Frederic Weisbecker , Len Brown , linux-xtensa@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-alpha@vger.kernel.org, linux-m68k , Linux ARM , Chris Zankel , Stephen Boyd , rh0@fb.com, dinguyen@kernel.org, Daniel Bristot de Oliveira , Alexander Shishkin , Lorenzo Pieralisi , Rasmus Villemoes , Joel Fernandes , Fabio Estevam , Boris Ostrovsky , Josh Triplett , Kevin Hilman , linux-csky@vger.kernel.org, Tony Lindgren , linux-snps-arc@lists.infradead.org, Mel Gorman , Jacob Pan , Yury Norov , ulli.kroll@googlemail.com, vgupta@kernel.org, linux-clk , Michal Simek , Steven Rostedt , rcu@vger.kernel.org, Borislav Petkov , bcain@quicinc.com, Thomas Bogendoerfer , Parisc List , Sudeep Holla , Shawn Guo , David Miller , Rich Felker , Peter Zijlstra , amakhalov@vmware.com, Bjorn Andersson , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-riscv , anton.ivanov@cambridgegreys.com, jonas@southpole.se, Arnd Bergmann , Richard Weinberger , the arch/x86 maintainers , Russell King - ARM Linux , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Heiko Carstens , openrisc@lists.librecores.org, Paul Walmsley , linux-tegra , namhyung@kernel.org, Andy Shevchenko , jpoimboe@kernel.org, Juergen Gross , pv-drivers@vmware.com, "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , Anup Patel , Ivan Kokshaysky , Johannes Berg , linuxppc-dev Errors-To: openrisc-bounces@lists.librecores.org Sender: "OpenRISC" On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19. 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BEC28C3F6B0 for ; Wed, 3 Aug 2022 13:51:21 +0000 (UTC) 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZLU7CF2TbMV/GhTVyTSMkJ78wDtvIOG/yKBw5KGw6Vs=; b=orwcq8p2kLLJq3 kqTht8Zn/mfCnrc+eE+NySVOth+OWyBpXvwjKRO3ahM1Yl2yIBQbY5T9RfkeBUpeZ2cXibqahO7Dd 1gFFvG6pI6DUjUdedDNOOn6obb2a/Qq33Wh9ktfwMvCba7StMIsPkk4aPeMJ6+gGTcQ/62gPyoPOI 88m1r6Fm8r/Xv1YYTu6rg3e5v/8UidCpcQxNdXgcNx9GUBKGKo9f2PIo7p+ofAQgr7L2633Qzcd4c V1dI7YifNlW72bM6nZHmCEZQD4CubFFhYQOJ6s8Dds5BodFbCnYgdmD6t3lgBzhU4PgMt96g19Hyw aewnA6e3+Q7Q/DkkSFRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJEm8-006UJh-B5; Wed, 03 Aug 2022 13:51:04 +0000 Received: from mail-yb1-f170.google.com ([209.85.219.170]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oHsW2-003v2b-HW; Sat, 30 Jul 2022 19:52:52 +0000 Received: by mail-yb1-f170.google.com with SMTP id r3so13188946ybr.6; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=0QwwjVOIVs4sR9ljVmsJX6Xu2S4+tvcr+oBVAjM+ePA=; b=ZSLiu1VDdrxC/pSQbsxPUapEhDJm4uRZ8LgKZlM3UzhBn2wy+Nj9fq4OMmH0d70OdO oNj9F+76OgtgZq1UtaElxN/OCzp13N6rnjJ+hVP97Az1yDMhBjkwtQV1gm6TEwa9Ecui IiBbXqXrswbXLlAyTidvITbY+AlEbFjCLG/BzQ2KIvkuRonJrDQO2Uh1ZWI1Ngh7Vn98 q+OHwoMZwlYM2IG2Ks4l5zflmU1wZYsNNjySfxkanXHM7NngKmxfKPSGF9tJFHT6pETU TGosdQBzpdFxmSm76kmQSrDKc3bHF/F+CX5FwBQ1S5Pp1qlAfF6C6v/Eq4ZPRFmXfjwW 5Nxg== X-Gm-Message-State: ACgBeo1yKLuzYGEd214LtDJFohZsF49jkz0kRgo9SoCDx4UWQfNN3FxV N0Cc/SF/3E/AVyH5A0PhW5rustqz6gyjwR9CP+U= X-Google-Smtp-Source: AA6agR5p+lnEO42NEIBehm6hZLFrmXewKv2ogwUWOYz3LvGYShyipeAc9YxoFpIxLibrvw9Jcl6WeqKY+cLq4G0/mNE= X-Received: by 2002:a25:3458:0:b0:673:5bca:3b45 with SMTP id b85-20020a253458000000b006735bca3b45mr6304433yba.633.1659210766011; Sat, 30 Jul 2022 12:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE To: Michel Lespinasse Cc: "Rafael J. Wysocki" , "Paul E. McKenney" , Peter Zijlstra , Richard Henderson , Ivan Kokshaysky , Matt Turner , vgupta@kernel.org, Russell King - ARM Linux , ulli.kroll@googlemail.com, Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , dl-linux-imx , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , kernel@xen0n.name, Geert Uytterhoeven , sammy@sammy.net, Michal Simek , Thomas Bogendoerfer , dinguyen@kernel.org, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , anton.ivanov@cambridgegreys.com, Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , acme@kernel.org, Mark Rutland , Alexander Shishkin , jolsa@kernel.org, namhyung@kernel.org, Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, pv-drivers@vmware.com, Boris Ostrovsky , Chris Zankel , Max Filippov , Len Brown , Pavel Machek , Greg Kroah-Hartman , Michael Turquette , Stephen Boyd , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jon Hunter , Jacob Pan , Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , senozhatsky@chromium.org, John Ogness , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, linux-alpha@vger.kernel.org, Linux Kernel Mailing List , linux-snps-arc@lists.infradead.org, Linux ARM , Linux OMAP Mailing List , linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k , "open list:BROADCOM NVRAM DRIVER" , openrisc@lists.librecores.org, Parisc List , linuxppc-dev , linux-riscv , linux-s390@vger.kernel.org, Linux-sh list , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-perf-users@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-xtensa@linux-xtensa.org, ACPI Devel Maling List , Linux PM , linux-clk , linux-arm-msm , linux-tegra , linux-arch , rcu@vger.kernel.org, rh0@fb.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220730_125250_607938_0DCEE593 X-CRM114-Status: GOOD ( 50.24 ) X-Mailman-Approved-At: Wed, 03 Aug 2022 06:50:55 -0700 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Date: Sat, 30 Jul 2022 19:52:34 +0000 Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE Message-Id: List-Id: References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> In-Reply-To: <20220730094800.GB1587@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset="macroman" Content-Transfer-Encoding: base64 To: Michel Lespinasse Cc: "Rafael J. Wysocki" , "Paul E. McKenney" , Peter Zijlstra , Richard Henderson , Ivan Kokshaysky , Matt Turner , vgupta@kernel.org, Russell King - ARM Linux , ulli.kroll@googlemail.com, Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , dl-linux-imx , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , kernel@xen0n.name, Geert Uytterhoeven , sammy@sammy.net, Michal Simek , Thomas Bogendoerfer , dinguyen@kernel.org, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , anton.ivanov@cambridgegreys.com, Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , the arch/x86 maintainers , "H. Peter Anvin" , acme@kernel.org, Mark Rutland , Alexander Shishkin , jolsa@kernel.org, namhyung@kernel.org, Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, pv-drivers@vmware.com, Boris Ostrovsky , Chris Zankel , Max Filippov , Len Brown , Pavel Machek , Greg Kroah-Hartman , Michael Turquette , Stephen Boyd , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jon Hunter , Jacob Pan , Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , senozhatsky@chromium.org, John Ogness , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, linux-alpha@vger.kernel.org, Linux Kernel Mailing List , linux-snps-arc@lists.infradead.org, Linux ARM , Linux OMAP Mailing List , linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k , "open list:BROADCOM NVRAM DRIVER" , openrisc@lists.librecores.org, Parisc List , linuxppc-dev , linux-riscv , linux-s390@vger.kernel.org, Linux-sh list , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-perf-users@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-xtensa@linux-xtensa.org, ACPI Devel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286Cj4gPiBodHRwczovL3BhdGNod29yay5rZXJuZWwub3JnL3By b2plY3QvbGludXgtcG0vcGF0Y2gvWXQvQXhQRmk4OG5lVzdXNUBlMTI2MzExLm1hbmNoZXN0ZXIu YXJtLmNvbS8KPiA+ID8KPgo+IEkgdHJpZWQsIGJ1dCBpdCBkaWRuJ3QgY2hhbmdlIHRoZSBwaWN0 dXJlIGZvciBtZS4KPgo+IEknbSBub3Qgc3VyZSBpZiB0aGF0IHdhcyB0aGUgcGF0Y2ggeW91IG1l YW50IHRvIHNlbmQgdGhvdWdoLCBhcyBpdAo+IHNlZW1zIGl0J3Mgb25seSBhZGRpbmcgYSB0cmFj ZXBvaW50IHNvIHNob3VsZG4ndCBtYWtlIGFueSBkaWZmZXJlbmNlCj4gaWYgSSdtIG5vdCBhY3R1 YWxseSB1c2luZyB0aGUgdHJhY2Vwb2ludCA/CgpZb3UgYXJlIHJpZ2h0LCBpdCBsb29rcyBsaWtl IEkgcGFzdGVkIGEgbGluayB0byBhIGRpZmZlcmVudCBwYXRjaCBieQptaXN0YWtlLiAgU29ycnkg YWJvdXQgdGhhdC4KCkkgbWVhbnQgdGhpcyBvbmU6CgpodHRwczovL2dpdC5rZXJuZWwub3JnL3B1 Yi9zY20vbGludXgva2VybmVsL2dpdC9yYWZhZWwvbGludXgtcG0uZ2l0L2NvbW1pdC8/aD1wbSZp ZNI5NWFkMzRmMjM2YzM1MTg2MzRmYjY0MDNkNGMwMTYwNDU2ZTQ3MAoKd2hpY2ggd2lsbCBhcHBl YXIgaW4gdGhlIGZpbmFsIDUuMTku From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE Date: Sat, 30 Jul 2022 21:52:34 +0200 Message-ID: References: <20220608142723.103523089@infradead.org> <20220608144516.172460444@infradead.org> <20220725194306.GA14746@lespinasse.org> <20220728172053.GA3607379@paulmck-ThinkPad-P17-Gen-1> <20220729102458.GA1695@lespinasse.org> <20220730094800.GB1587@lespinasse.org> Mime-Version: 1.0 Return-path: In-Reply-To: <20220730094800.GB1587@lespinasse.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michel Lespinasse Cc: "Rafael J. Wysocki" , "Paul E. McKenney" , Peter Zijlstra , Richard Henderson , Ivan Kokshaysky , Matt Turner , vgupta@kernel.org, Russell King - ARM Linux , ulli.kroll@googlemail.com, Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , dl-linux-imx , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai On Sat, Jul 30, 2022 at 11:48 AM Michel Lespinasse wrote: > > On Fri, Jul 29, 2022 at 04:59:50PM +0200, Rafael J. Wysocki wrote: > > On Fri, Jul 29, 2022 at 12:25 PM Michel Lespinasse > > wrote: > > > > > > On Thu, Jul 28, 2022 at 10:20:53AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul 25, 2022 at 12:43:06PM -0700, Michel Lespinasse wrote: > > > > > On Wed, Jun 08, 2022 at 04:27:27PM +0200, Peter Zijlstra wrote: > > > > > > Commit c227233ad64c ("intel_idle: enable interrupts before C1 on > > > > > > Xeons") wrecked intel_idle in two ways: > > > > > > > > > > > > - must not have tracing in idle functions > > > > > > - must return with IRQs disabled > > > > > > > > > > > > Additionally, it added a branch for no good reason. > > > > > > > > > > > > Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > > > > > > > After this change was introduced, I am seeing "WARNING: suspicious RCU > > > > > usage" when booting a kernel with debug options compiled in. Please > > > > > see the attached dmesg output. The issue starts with commit 32d4fd5751ea > > > > > and is still present in v5.19-rc8. > > > > > > > > > > I'm not sure, is this too late to fix or revert in v5.19 final ? > > > > > > > > I finally got a chance to take a quick look at this. > > > > > > > > The rcu_eqs_exit() function is making a lockdep complaint about > > > > being invoked with interrupts enabled. This function is called from > > > > rcu_idle_exit(), which is an expected code path from cpuidle_enter_state() > > > > via its call to rcu_idle_exit(). Except that rcu_idle_exit() disables > > > > interrupts before invoking rcu_eqs_exit(). > > > > > > > > The only other call to rcu_idle_exit() does not disable interrupts, > > > > but it is via rcu_user_exit(), which would be a very odd choice for > > > > cpuidle_enter_state(). > > > > > > > > It seems unlikely, but it might be that it is the use of local_irq_save() > > > > instead of raw_local_irq_save() within rcu_idle_exit() that is causing > > > > the trouble. If this is the case, then the commit shown below would > > > > help. Note that this commit removes the warning from lockdep, so it > > > > is necessary to build the kernel with CONFIG_RCU_EQS_DEBUG=y to enable > > > > equivalent debugging. > > > > > > > > Could you please try your test with the -rce commit shown below applied? > > > > > > Thanks for looking into it. > > > > > > After checking out Peter's commit 32d4fd5751ea, > > > cherry picking your commit ed4ae5eff4b3, > > > and setting CONFIG_RCU_EQS_DEBUG=y in addition of my usual debug config, > > > I am now seeing this a few seconds into the boot: > > > > > > [ 3.010650] ------------[ cut here ]------------ > > > [ 3.010651] WARNING: CPU: 0 PID: 0 at kernel/sched/clock.c:397 sched_clock_tick+0x27/0x60 > > > [ 3.010657] Modules linked in: > > > [ 3.010660] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc1-test-00005-g1be22fea0611 #1 > > > [ 3.010662] Hardware name: LENOVO 30BFS44D00/1036, BIOS S03KT51A 01/17/2022 > > > [ 3.010663] RIP: 0010:sched_clock_tick+0x27/0x60 > > > [ 3.010665] Code: 1f 40 00 53 eb 02 5b c3 66 90 8b 05 2f c3 40 01 85 c0 74 18 65 8b 05 60 88 8f 4e 85 c0 75 0d 65 8b 05 a9 85 8f 4e 85 c0 74 02 <0f> 0b e8 e2 6c 89 00 48 c7 c3 40 d5 02 00 > > > 89 c0 48 03 1c c5 c0 98 > > > [ 3.010667] RSP: 0000:ffffffffb2803e28 EFLAGS: 00010002 > > > [ 3.010670] RAX: 0000000000000001 RBX: ffffc8ce7fa07060 RCX: 0000000000000001 > > > [ 3.010671] RDX: 0000000000000000 RSI: ffffffffb268dd21 RDI: ffffffffb269ab13 > > > [ 3.010673] RBP: 0000000000000001 R08: ffffffffffc300d5 R09: 000000000002be80 > > > [ 3.010674] R10: 000003625b53183a R11: ffffa012b802b7a4 R12: ffffffffb2aa9e80 > > > [ 3.010675] R13: ffffffffb2aa9e00 R14: 0000000000000001 R15: 0000000000000000 > > > [ 3.010677] FS: 0000000000000000(0000) GS:ffffa012b8000000(0000) knlGS:0000000000000000 > > > [ 3.010678] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > [ 3.010680] CR2: ffffa012f81ff000 CR3: 0000000c99612001 CR4: 00000000003706f0 > > > [ 3.010681] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > [ 3.010682] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > [ 3.010683] Call Trace: > > > [ 3.010685] > > > [ 3.010688] cpuidle_enter_state+0xb7/0x4b0 > > > [ 3.010694] cpuidle_enter+0x29/0x40 > > > [ 3.010697] do_idle+0x1d4/0x210 > > > [ 3.010702] cpu_startup_entry+0x19/0x20 > > > [ 3.010704] rest_init+0x117/0x1a0 > > > [ 3.010708] arch_call_rest_init+0xa/0x10 > > > [ 3.010711] start_kernel+0x6d8/0x6ff > > > [ 3.010716] secondary_startup_64_no_verify+0xce/0xdb > > > [ 3.010728] > > > [ 3.010729] irq event stamp: 44179 > > > [ 3.010730] hardirqs last enabled at (44179): [] asm_sysvec_apic_timer_interrupt+0x1b/0x20 > > > [ 3.010734] hardirqs last disabled at (44177): [] __do_softirq+0x3f0/0x498 > > > [ 3.010736] softirqs last enabled at (44178): [] __do_softirq+0x332/0x498 > > > [ 3.010738] softirqs last disabled at (44171): [] irq_exit_rcu+0xab/0xf0 > > > [ 3.010741] ---[ end trace 0000000000000000 ]--- > > > > Can you please give this patch a go: > > https://patchwork.kernel.org/project/linux-pm/patch/Yt/AxPFi88neW7W5@e126311.manchester.arm.com/ > > ? > > I tried, but it didn't change the picture for me. > > I'm not sure if that was the patch you meant to send though, as it > seems it's only adding a tracepoint so shouldn't make any difference > if I'm not actually using the tracepoint ? You are right, it looks like I pasted a link to a different patch by mistake. Sorry about that. I meant this one: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=pm&id=d295ad34f236c3518634fb6403d4c0160456e470 which will appear in the final 5.19.