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

Reply via email to