public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.
@ 2024-10-04 10:17 Sebastian Andrzej Siewior
  2024-10-04 10:17 ` [PATCH 1/1] " Sebastian Andrzej Siewior
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-10-04 10:17 UTC (permalink / raw)
  To: linux-kernel, rcu
  Cc: Paul E. McKenney, Anna-Maria Behnsen, Davidlohr Bueso,
	Frederic Weisbecker, Ingo Molnar, Josh Triplett, Thomas Gleixner

Hi,

the following was in the PREEMPT_RT queue since last softirq rework. The
result is that timer wake ups (hrtimer, timer_list) happens in hardirq
processing them requires to wake ksoftirqd leading two:
- ksoftirqd will consume all further softirqs. That means all
  soft interrupts that would be processed in the threaded interrupt will
  no be delayed to ksoftirqd. The threaded interrupt runs at higher
  priority than ksoftirqd.

- ksoftirqd runs at SCHED_OTHER so it will compete for resources with
  all other tasks in the system, potentially delayed the processing
  further.

The idea was to let the timers be processed by a dedicated thread
running at low SCHED_FIFO priority.
While looking at it again, it might make sense to have the
pending_softirq flag per-thread to avoid threads with higher priority
picking up softirqs from low-priority threads. This isn't yet a problem
because adding softirqs for processing happens only from threaded
interrupts. So the low-priority thread will wait until the high-priority
thread is done. And the high-priority thread will PI-boost the
low-priority thread until it is done. It would only make sense to make
the flags per-thread once the BH lock is gone.

The patch is limited to PREEMPT_RT. The ksoftirqd bullets from above
apply also to !PREEMPT_RT +threadirqs. Would it make sense to restrict
it to force_irqthreads() instead?

Sebastian


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-10-24 14:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox