public inbox for rcu@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Ingo Molnar <mingo@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.
Date: Thu, 24 Oct 2024 16:02:17 +0200	[thread overview]
Message-ID: <ZxpTaXwmas8a0QuK@localhost.localdomain> (raw)
In-Reply-To: <20241023105257.3Ibh0V5d@linutronix.de>

Le Wed, Oct 23, 2024 at 12:52:57PM +0200, Sebastian Andrzej Siewior a écrit :
> On 2024-10-23 08:30:18 [+0200], To Frederic Weisbecker wrote:
> > > > > > +void raise_timer_softirq(void)
> > > > > > +{
> > > > > > +	unsigned long flags;
> > > > > > +
> > > > > > +	local_irq_save(flags);
> > > > > > +	raise_ktimers_thread(TIMER_SOFTIRQ);
> > > > > > +	wake_timersd();
> > > > > 
> > > > > This is supposed to be called from hardirq only, right?
> > > > > Can't irq_exit_rcu() take care of it? Why is it different
> > > > > from HRTIMER_SOFTIRQ ?
> > > > 
> > > > Good question. This shouldn't be any different compared to the hrtimer
> > > > case. This is only raised in hardirq, so yes, the irq_save can go away
> > > > and the wake call, too.
> > > 
> > > Cool. You can add lockdep_assert_in_irq() within raise_ktimers_thread() for
> > > some well deserved relief :-)
> > 
> > If you want to, sure. I would add them to both raise functions.
> 
> That function (run_local_timers()) was in past also called from other
> places like the APIC IRQ but all this is gone now. The reason why I
> added the wake and the local_irq_save() is because it uses
> raise_softirq() instead raise_softirq_irqoff(). And raise_softirq() was
> used since it was separated away from tasklets.
> 
> Now, raise_timer_softirq() is a function within softirq.c because it
> needs to access task_struct timersd which was only accessible there. It
> has been made public later due to the rcutorture bits so it could be
> very much be made inline and reduced to just raise_ktimers_thread().
> I tend to make TIMER_SOFTIRQ use also raise_softirq_irqoff() to make it
> look the same.

Sounds good!

> That lockdep_assert_in_irq() is probably cheap but it
> might look odd why RT needs or just TIMER and not HRTIMER.

I guess adding the same test on inline !RT functions in bottom_half.h
will be challening... Perhaps forget about that idea...

Thanks.

      reply	other threads:[~2024-10-24 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 10:17 [PATCH 0/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT Sebastian Andrzej Siewior
2024-10-04 10:17 ` [PATCH 1/1] " Sebastian Andrzej Siewior
2024-10-21 23:17   ` Paul E. McKenney
2024-10-22 13:28   ` Frederic Weisbecker
2024-10-22 15:34     ` Sebastian Andrzej Siewior
2024-10-22 22:27       ` Frederic Weisbecker
2024-10-23  6:30         ` Sebastian Andrzej Siewior
2024-10-23 10:10           ` Frederic Weisbecker
2024-10-23 10:52           ` Sebastian Andrzej Siewior
2024-10-24 14:02             ` Frederic Weisbecker [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=ZxpTaXwmas8a0QuK@localhost.localdomain \
    --to=frederic@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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