On Wed, Oct 14, 2020 at 9:02 PM Peter Zijlstra <[email protected]> wrote: > > On Mon, Oct 12, 2020 at 09:50:44PM +0800, Pingfan Liu wrote: > > __do_softirq() may be interrupted by hardware interrupts. In this case, > > irqtime_account_irq() will account the time slice as CPUTIME_SOFTIRQ by > > mistake. > > > > By passing irqtime_account_irq() an extra param about either hardirq or > > softirq, irqtime_account_irq() can handle the above case. > > I'm not sure I see the scenario in which it goes wrong. > > irqtime_account_irq() is designed such that we're called with the old > preempt_count on enter and the new preempt_count on exit. This way we'll > accumuate the delta to the previous context. > Oops! You are right, the time delta between a softirq and a interrupting hardirq should be accounted into the softrq.
Thanks for your clear explanation. Regards, Pingfan

