From: Boqun Feng <boqun.feng@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3] lockdep: add lockdep_cleanup_dead_cpu()
Date: Thu, 26 Sep 2024 08:13:46 -0700 [thread overview]
Message-ID: <ZvV6Kg-qe4e4DigZ@boqun-archlinux> (raw)
In-Reply-To: <53d3d2e143eac428312ea74c8e6209aef1737a63.camel@infradead.org>
On Thu, Sep 26, 2024 at 03:34:57PM +0100, David Woodhouse wrote:
> On Thu, 2024-09-26 at 05:34 -0700, Boqun Feng wrote:
> > On Thu, Sep 26, 2024 at 01:16:32PM +0100, David Woodhouse wrote:
> > > On Thu, 2024-09-26 at 05:09 -0700, Boqun Feng wrote:
> > > >
> > > >
> > > > I think this is already fixed by:
> > > >
> > > > 9bb69ba4c177 ("ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead()")
> > > >
> > > > , no?
> > >
> > > That patch fixed the bug.
> > >
> > > *This* patch fixes the fact that lockdep didn't *tell* us about the bug.
> >
> > But I thought along with the above commit, Peter also made it possible
> > that objtool can detect leaving noinstr section in the offline path? Do
> > you have a case where you can alter hardirqs_enabled flag in offline
> > path but don't hit the objtool warning?
>
> I do not recall such. Peter?
>
Oh I mis-read Peter's response here:
https://lore.kernel.org/lkml/20231027191435.GF26550@noisy.programming.kicks-ass.net/
, so seems the noinstr annotating for CPU offline path is still a WIP.
> IIRC the bug fixed by commit 9bb69ba4c177 only showed up under real
> Xen, as QEMU doesn't expose processor C-states. So I reintroduced the
> equivalent bug by doing this instead:
>
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -1390,7 +1390,7 @@ void __noreturn hlt_play_dead(void)
> wbinvd();
>
> while (1)
> - native_halt();
> + safe_halt();
> }
>
>
> Without this patch, I get a triple-fault on bringing the CPU back
> online as before. With it, as intended, I get a warning, but success:
>
> [root@localhost ~]# echo 0 > /sys/devices/system/cpu/cpu1/online
> [ 42.090839] smpboot: CPU 1 is now offline
> [ 42.091989] CPU 1 left hardirqs enabled!
> [ 42.091997] irq event stamp: 144559
> [ 42.094155] hardirqs last enabled at (144559): [<ffffffff89098b2e>] hlt_play_dead+0x1e/0x30
> [ 42.096196] hardirqs last disabled at (144558): [<ffffffff891800ee>] do_idle+0xae/0x260
> [ 42.098062] softirqs last enabled at (144530): [<ffffffff89107260>] __irq_exit_rcu+0xb0/0xd0
> [ 42.100056] softirqs last disabled at (144519): [<ffffffff89107260>] __irq_exit_rcu+0xb0/0xd0
> [root@localhost ~]# echo 1 > /sys/devices/system/cpu/cpu1/online
> [ 47.480889] installing Xen timer for CPU 1
> [ 47.485308] smpboot: Booting Node 0 Processor 1 APIC 0x1
> [ 47.491569] cpu 1 spinlock event irq 35
>
>
> So I think the patch is still applicable.
>
Yeah, it was just that I thought we have static checking for the issue
(via objtool), and I think that's slightly better, because it covers
more problems.
> > Anyway, the commit log needs a rework.
>
> Sure. Other than to refer to commit 9bb69ba4c177 instead of the mailing
> list message, is there anything else that needs changing? I suppose I
> should drop the word 'recently' from '...was recently observed'? :)
>
Given that Peter did send a POC for static checking:
https://lore.kernel.org/lkml/20231030111724.GA12604@noisy.programming.kicks-ass.net/
Maybe you could explain why this is needed even though static checking
is technically possible? Thanks!
Regards,
Boqun
next prev parent reply other threads:[~2024-09-26 15:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 11:14 [PATCH] lockdep: add lockdep_cleanup_dead_cpu() David Woodhouse
2023-10-28 14:13 ` Thomas Gleixner
2023-10-28 17:14 ` kernel test robot
2023-10-28 19:24 ` [PATCH v2] " David Woodhouse
2023-10-29 10:05 ` kernel test robot
2023-10-29 17:33 ` Thomas Gleixner
2023-10-29 17:47 ` David Woodhouse
2023-10-30 8:45 ` [PATCH v3] " David Woodhouse
2024-09-24 14:20 ` David Woodhouse
2024-09-26 12:09 ` Boqun Feng
2024-09-26 12:16 ` David Woodhouse
2024-09-26 12:34 ` Boqun Feng
2024-09-26 14:34 ` David Woodhouse
2024-09-26 15:13 ` Boqun Feng [this message]
2024-09-26 15:38 ` David Woodhouse
2023-10-30 16:37 ` [PATCH v2] " kernel test robot
2023-10-30 11:17 ` [PATCH] " Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZvV6Kg-qe4e4DigZ@boqun-archlinux \
--to=boqun.feng@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).