Re: [PATCH] sched/cputime: Make IRQ time accounting configurable at boot time

From: Qais Yousef
Date: Fri Jun 30 2023 - 11:01:16 EST


On 06/16/23 09:45, Peter Zijlstra wrote:
> On Thu, Jun 15, 2023 at 01:37:26PM -0700, Bart Van Assche wrote:
> > Some producers of Android devices want IRQ time accounting enabled while
> > others want IRQ time accounting disabled. Hence, make IRQ time accounting
> > configurable at boot time.
>
> Why would they want this disabled? IRQ time accounting avoids a number
> of issues under high irq/softirq pressure.
>
> Disabling this makes no sense.

I think it is assumed that IRQ time accounting is only used for stat
collection (which is what I thought too), but based on this response I can see
it is used to ensure we account for stolen time in update_rq_clock_task() so it
helps to make it account more accurately for the time a task actually spent
running and doing useful work.

Bart, could you profile the cause of the high overhead? The config message says
a small perf impact, but 40% mentioned in your v2 is high. Could you try to
break down the problem further as we might be overlooking the true source of
overhead or miss an opportunity to improve the accounting logic instead?


Thanks

--
Qais Yousef