Re: [PATCH v2] lockdep: add lockdep_cleanup_dead_cpu()
From: David Woodhouse
Date: Fri Sep 27 2024 - 04:45:26 EST
On Thu, 2024-09-26 at 17:45 -0700, Boqun Feng wrote:
> On Thu, Sep 26, 2024 at 05:37:12PM +0100, David Woodhouse wrote:
> > On Thu, 2024-09-26 at 09:09 -0700, Boqun Feng wrote:
> > >
> > > I won't call this a "perfectly harmless bug", safe_halt() also contains
> > > tracepoints, which are not supposed to work in offline path IIUC, for
> > > example, you may incorrectly use RCU when RCU is not watching, that
> > > could mean reading garbage memory (surely it won't crash the system, but
> > > I hope I never need to debug such a system ;-)).
> > >
> > > Otherwise this patch looks good to me. Thanks!
> >
> > Apart from the fact that I can't count. Apparently I got up to v3 of it
> > last time, so this one should have been v4. I just mostly forgot all
> > about it, and found it lying around in a git tree a year later, and it
> > still seemed relevant.
>
> My point is calling a non-noinstr function in the offline path is not a
> "perfectly harmless" bug, it can cause serious results, so that line in
> the commit log is not true. Of course, lockdep should handle buggy code
> gracefully, but buggy code is still buggy code.
As you wish. It was very much *less* harmful than a triple-fault, and I
would at least have left something in the commit comment about lockdep
making the user-visible symptoms much worse (and hard to debug; that's
a few days of my life I want back!) — but your point is valid, and it's
not a hill to die on.
> Anyway, I've taken it into my tree (I removed the "perfectly harmless
> bug" part because of the reason above):
>
> git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git lockdep-for-tip
>
> and will send it in a PR to tip around -rc2 to -rc4, so it will goes
> into v6.13 if things went well.
>
> Feel free to send a new version, if the one in my tree needs some
> changes. Again, thanks for the patch!
I think it'll do. Thanks for picking it up.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature