Re: [PATCH v2] sched/cputime: exclude ktimers threads in irqtime_account_irq

From: Sebastian Andrzej Siewior
Date: Thu Nov 30 2023 - 07:00:55 EST


On 2023-11-30 17:41:47 [+0800], tiozhang wrote:
> In CONFIG_PREEMPT_RT kernel, ktimers also calls __do_softirq,
> so when accounting CPUTIME_SOFTIRQ, ktimers need to be excluded
> as well as ksoftirqd.
> Also add this_cpu_ktimers to keep consistency with this_cpu_ksoftirqd.

I'm still not sure what the benefit here is. It says align with
ksoftirqd but why? Why don't we account softirq time for ksoftirqd (and
should continue to do so for ktimersd)?

ktimers runs almost all the time in softirq context. So does every
force-threaded interrupt. Should we exclude them, too?

Sebastian