[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.20.1606141333260.1714@knanqh.ubzr>
Date: Tue, 14 Jun 2016 13:46:34 -0400 (EDT)
From: Nicolas Pitre <nicolas.pitre@...aro.org>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
cc: tglx@...utronix.de, shreyas@...ux.vnet.ibm.com,
linux-kernel@...r.kernel.org, peterz@...radead.org,
rafael@...nel.org, vincent.guittot@...aro.org
Subject: Re: [PATCH V5] irq: Track the interrupt timings
On Tue, 14 Jun 2016, Daniel Lezcano wrote:
[...]
> +void __handle_timings(struct irq_desc *desc)
> +{
> + struct irq_timings *timings;
> + u64 prev, now, diff;
> +
> + timings = this_cpu_ptr(desc->timings);
> + now = local_clock();
> + prev = timings->timestamp;
> + timings->timestamp = now;
> +
> + /*
> + * In case it is the first time this function is called, the
> + * 'prev' variable will be zero which reflects the time origin
> + * when the system booted.
> + */
> + diff = now - prev;
> +
> + /* The oldest value corresponds to the next index. */
> + timings->w_index = (timings->w_index + 1) & IRQ_TIMINGS_MASK;
> + timings->values[timings->w_index] = diff;
> +}
What about simply this:
void __handle_timings(struct irq_desc *desc)
{
struct irq_timings *timings = this_cpu_ptr(desc->timings);
timings->w_index = (timings->w_index + 1) & IRQ_TIMINGS_MASK;
timings->values[timings->w_index] = local_clock();
}
?
Then you could s/__handle_timings/__record_irq_time/ to better represent
what it does. And both the difference and the summing of squares could
be done upon entering idle instead.
Nicolas
Powered by blists - more mailing lists