lkml.org 
[lkml]   [2017]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 2/3] irq: Track the interrupt timings
On Thu, 23 Mar 2017, Daniel Lezcano wrote:

> +#define IRQ_TIMINGS_SHIFT 5
> +#define IRQ_TIMINGS_SIZE (1 << IRQ_TIMINGS_SHIFT)
> +#define IRQ_TIMINGS_MASK (IRQ_TIMINGS_SIZE - 1)
> +
> +struct irq_timing {
> + u32 irq;
> + u64 ts;
> +};
> +
> +struct irq_timings {
> + struct irq_timing values[IRQ_TIMINGS_SIZE]; /* our circular buffer */

This is not very space efficient because of alignment restrictions from
the u64 in struct irq_timing. 25% of the memory is wasted.

You could consider having two arrays instead:

u32 irq_values[IRQ_TIMINGS_SIZE];
u64 ts_values[IRQ_TIMINGS_SIZE];


Nicolas

\
 
 \ /
  Last update: 2017-03-23 20:15    [W:0.138 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site