From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Frederic Weisbecker <frederic@kernel.org>
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 v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.
Date: Wed, 30 Oct 2024 11:02:09 +0100 [thread overview]
Message-ID: <20241030100209.p9JX4qDb@linutronix.de> (raw)
In-Reply-To: <ZyFX6R_7HptXRdsK@pavilion.home>
On 2024-10-29 22:47:21 [+0100], Frederic Weisbecker wrote:
> Le Tue, Oct 29, 2024 at 02:52:31PM +0100, Sebastian Andrzej Siewior a écrit :
> > On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote:
> > > > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> > > > index 457151f9f263d..9637af78087f3 100644
> > > > --- a/include/linux/interrupt.h
> > > > +++ b/include/linux/interrupt.h
> > > > @@ -616,6 +616,50 @@ extern void __raise_softirq_irqoff(unsigned int nr);
> > > > extern void raise_softirq_irqoff(unsigned int nr);
> > > > extern void raise_softirq(unsigned int nr);
> > > >
> > > > +/*
> > > > + * Handle timers in a dedicated thread at a low SCHED_FIFO priority instead in
> > > > + * ksoftirqd as to be prefred over SCHED_NORMAL tasks.
> > > > + */
> > >
> > > This doesn't parse. How about, inspired by your changelog:
> > …
> >
> > What about this essay instead:
> >
> > | With forced-threaded interrupts enabled a raised softirq is deferred to
> > | ksoftirqd unless it can be handled within the threaded interrupt. This
> > | affects timer_list timers and hrtimers which are explicitly marked with
> > | HRTIMER_MODE_SOFT.
> > | With PREEMPT_RT enabled more hrtimers are moved to softirq for processing
> > | which includes all timers which are not explicitly marked HRTIMER_MODE_HARD.
> > | Userspace controlled timers (like the clock_nanosleep() interface) is divided
> > | into two categories: Tasks with elevated scheduling policy including
> > | SCHED_{FIFO|RR|DL} and the remaining scheduling policy. The tasks with the
> > | elevated scheduling policy are woken up directly from the HARDIRQ while all
> > | other wake ups are delayed to so softirq and so to ksoftirqd.
>
> First "so" is intended?
No, it needs to go.
> > |
> > | The ksoftirqd runs at SCHED_OTHER policy at which it should remain since it
> > | handles the softirq in an overloaded situation (not handled everything
> > | within its last run).
> > | If the timers are handled at SCHED_OTHER priority then they competes with all
> > | other SCHED_OTHER tasks for CPU resources are possibly delayed.
> > | Moving timers softirqs to a low priority SCHED_FIFO thread instead ensures
> > | that timer are performed before scheduling any SCHED_OTHER thread.
>
> Works for me!
Great.
> > And with this piece of text I convinced myself to also enable this in
> > the forced-threaded case.
>
> Yes, that makes sense.
Good. Then I'm pick to up your tag for that patch. Thank you.
> Thanks.
>
Sebastian
prev parent reply other threads:[~2024-10-30 10:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 14:55 [PATCH v2 0/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT Sebastian Andrzej Siewior
2024-10-24 14:55 ` [PATCH v2 1/3] hrtimer: Use __raise_softirq_irqoff() to raise the softirq Sebastian Andrzej Siewior
2024-10-28 13:11 ` Frederic Weisbecker
2024-10-24 14:55 ` [PATCH v2 2/3] timers: " Sebastian Andrzej Siewior
2024-10-28 13:13 ` Frederic Weisbecker
2024-10-24 14:55 ` [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT Sebastian Andrzej Siewior
2024-10-28 14:01 ` Frederic Weisbecker
2024-10-29 13:52 ` Sebastian Andrzej Siewior
2024-10-29 21:47 ` Frederic Weisbecker
2024-10-30 10:02 ` Sebastian Andrzej Siewior [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=20241030100209.p9JX4qDb@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=dave@stgolabs.net \
--cc=frederic@kernel.org \
--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