Re: [PATCH 2/3] sched/cputime: code cleanup in irqtime_account_process_tick

From: Alex Shi
Date: Thu Jan 09 2020 - 08:31:59 EST



>> I fear we can't really play the exact same game as account_process_tick() here.
>> Since this is irqtime precise accounting, we have already computed the
>> irqtime delta in account_other_time() (or we will at some point in the future)
>> and substracted it from the ticks to account. This means that the remaining cputime
>> to account has to be either utime/stime/gtime/idle-time but not interrupt time, or
>> we may account interrupt time twice. And account_system_time() tries to account
>> irq time, for example if we interrupt a softirq.
>
> OK, I've dropped 2 and 3. Thanks Frederic!
>

Hi Frederic & Peter,

Thanks a lot for the comments and review!
It's my fault to mess up the account_system_time details. And seems there is no easy way to replace irqtime_account_process_tick or account_process_tick with each other.

but on the other side, the account_idle_ticks could be replaced by irqtime_account_process_tick, or at least to remove irqtime_account_idle_ticks function. Any comments?

Thanks
Alex

---