Re: [RFC][PATCH] hrtimer: Use printk_deferred_once for hrtimer_interrupt message

John Stultz
2024-02-22T20:47:53Z

On Thu, Feb 22, 2024 at 12:33 PM John Ogness <jogness@linutronix.de> wrote:
> On 2024-02-22, John Stultz <jstultz@google.com> wrote:
> > On Thu, Feb 22, 2024 at 7:17 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> >> On Wed, Feb 21 2024 at 21:12, John Stultz wrote:
> >> > With qemu, I constantly see lockdep warnings after the
> >> > hrimter_interrupt message is printed:
> >> >
> >> > [ 43.434557] hrtimer: interrupt took 6517564 ns
> >> > [ 43.435000]
> >> > [ 43.435000] =============================
> >> > [ 43.435000] [ BUG: Invalid wait context ]
> >>
> >> Do you have PROVE_RAW_LOCK_NESTING enabled?
> >
> > Yes, I do. Let me know if there's anything else you'd like me to try.
>
> This option is to "ensure that the lock nesting rules for PREEMPT_RT
> enabled kernels are not violated."
>
> Since you are not running a PREEMPT_RT enabled kernel, these warnings
> are irrelevant for _your_ kernel.

Ah, mostly I've been running with all the lockdep options as part of
my development of proxy-exec series, as I want to avoid accidentally
introducing any new problems with my work.

> >> > I thought the new printk work was going to resolve this, but
> >> > apparently not
>
> Yes, it will, but it is not all mainline yet. The full printk rework is
> only available as part of the PREEMPT_RT patch series [0]. With that

Ah, my apologies! I know the printk changes are *very* eagerly
awaited, but I haven't been following it closely, and at plumbers I
had the mistaken sense that the key parts had been queued to be merged
in 6.8.

> If you really want to test lock nesting for PREEMPT_RT, I recommend
> applying the PREEMPT_RT series and keeping PROVE_RAW_LOCK_NESTING
> enabled. Otherwise, if you do not want to apply the PREEMPT_RT series, I
> recommend disabling PROVE_RAW_LOCK_NESTING.
>

Ok, will do. Though would it make sense to hide
PROVE_RAW_LOCK_NESTING under BROKEN or something upstream in the
meantime?

Thanks so much for the response and your efforts on the printk improvements!
-john