Lines Matching refs:irqs
382 static u64 __irq_timings_next_event(struct irqt_stat *irqs, int irq, u64 now) in __irq_timings_next_event() argument
386 if ((now - irqs->last_ts) >= NSEC_PER_SEC) { in __irq_timings_next_event()
387 irqs->count = irqs->last_ts = 0; in __irq_timings_next_event()
396 period_max = irqs->count > (3 * PREDICTION_PERIOD_MAX) ? in __irq_timings_next_event()
397 PREDICTION_PERIOD_MAX : irqs->count / 3; in __irq_timings_next_event()
409 count = irqs->count < IRQ_TIMINGS_SIZE ? in __irq_timings_next_event()
410 irqs->count : IRQ_TIMINGS_SIZE; in __irq_timings_next_event()
412 start = irqs->count < IRQ_TIMINGS_SIZE ? in __irq_timings_next_event()
413 0 : (irqs->count & IRQ_TIMINGS_MASK); in __irq_timings_next_event()
424 irqs->timings[i] = irqs->circ_timings[index]; in __irq_timings_next_event()
425 min = min_t(int, irqs->timings[i], min); in __irq_timings_next_event()
428 index = irq_timings_next_event_index(irqs->timings, count, period_max); in __irq_timings_next_event()
430 return irqs->last_ts + irqs->ema_time[min]; in __irq_timings_next_event()
432 return irqs->last_ts + irqs->ema_time[index]; in __irq_timings_next_event()
446 static __always_inline void __irq_timings_store(int irq, struct irqt_stat *irqs, in __irq_timings_store() argument
457 irqs->count = 0; in __irq_timings_store()
465 irqs->circ_timings[irqs->count & IRQ_TIMINGS_MASK] = index; in __irq_timings_store()
467 irqs->ema_time[index] = irq_timings_ema_new(interval, in __irq_timings_store()
468 irqs->ema_time[index]); in __irq_timings_store()
470 irqs->count++; in __irq_timings_store()
473 static inline void irq_timings_store(int irq, struct irqt_stat *irqs, u64 ts) in irq_timings_store() argument
475 u64 old_ts = irqs->last_ts; in irq_timings_store()
482 irqs->last_ts = ts; in irq_timings_store()
503 irqs->count = 0; in irq_timings_store()
507 __irq_timings_store(irq, irqs, interval); in irq_timings_store()
539 struct irqt_stat *irqs; in irq_timings_next_event() local
581 irqs = this_cpu_ptr(s); in irq_timings_next_event()
583 ts = __irq_timings_next_event(irqs, i, now); in irq_timings_next_event()
777 struct irqt_stat *irqs; in irq_timings_test_irqs() local
792 irqs = this_cpu_ptr(s); in irq_timings_test_irqs()
800 __irq_timings_store(irq, irqs, ti->intervals[i]); in irq_timings_test_irqs()
801 if (irqs->circ_timings[i & IRQ_TIMINGS_MASK] != index) { in irq_timings_test_irqs()
808 if (irqs->count != ti->count) { in irq_timings_test_irqs()