mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Cc: Thomas Gleixner <tglx@kernel.org>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Will Deacon <will@kernel.org>, Boqun Feng <boqun@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Karl Mehltretter <kmehltretter@gmail.com>,
	linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [RFC PATCH] entry: Account the deferred hrtimer rearm as hardirq context for lockdep
Date: Tue, 13 Oct 2026 08:38:04 +0200	[thread overview]
Message-ID: <20261013063804.GX2009045@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261013060448.751816-1-mikhail.v.gavrilov@gmail.com>

On Tue, Oct 13, 2026 at 11:04:48AM +0500, Mikhail Gavrilov wrote:
> On Mon, Oct 12, 2026 at 05:21:20PM +0200, Peter Zijlstra wrote:

> > That said; I wonder if we want more of irqentry_exit_to_kernel_mode()
> > wrapped like this. The schedule_preempt_irq() thing will now also stack
> > rq->lock and the like on top of 'random' kernel stacks, rather than
> > keeping it in 'empty' hardirq contexts.
> >
> > Or am I making a mess of things?
> 
> Apart from the rearm, the preemption is the only thing in there that
> takes locks, and I don't see a way to run it in lockdep's hardirq
> context: preempt_schedule_irq() enables interrupts before calling
> __schedule(), which trips the lockdep_hardirq_context() check in
> lockdep_hardirqs_on_prepare(), and hardirq_context is per CPU, so it
> would stay set for whatever task __schedule() switches to.

Right; that won't do.

> Nor is the shape specific to the interrupt return: schedule() under a
> held sleeping lock stacks rq->lock on that lock the same way. In the
> 46.6 hour boot, chains with rq->__lock on top of other held locks were
> 18.1% of the pool, and lockdep_chains does not tell which of them came
> from preemption.

That's roughly 2 out of 11. Not sure that's worth it. If I get another
crazy idea I'll let you know ;-)

      reply	other threads:[~2026-10-13  6:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 20:46 Mikhail Gavrilov
2026-10-12 15:21 ` Peter Zijlstra
2026-10-13  6:04   ` Mikhail Gavrilov
2026-10-13  6:38     ` Peter Zijlstra [this message]

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=20261013063804.GX2009045@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=boqun@kernel.org \
    --cc=clrkwllms@kernel.org \
    --cc=kmehltretter@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=longman@redhat.com \
    --cc=luto@kernel.org \
    --cc=mikhail.v.gavrilov@gmail.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@kernel.org \
    --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

all inboxes | Powered by JetHome®