Skip to content

Commit c119e66

Browse files
Marc ZyngierKAGA-KOKO
authored andcommitted
genirq: Remove IRQ timing tracking infrastructure
The IRQ timing tracking infrastructure was merged in 2019, but was never plumbed in, is not selectable, and is therefore never used. As Daniel agrees that there is little hope for this infrastructure to be completed in the near term, drop it altogether. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/87zf7vex6h.wl-maz@kernel.org Link: https://patch.msgid.link/20251210082242.360936-2-maz@kernel.org
1 parent 8f0b4cc commit c119e66

8 files changed

Lines changed: 0 additions & 1095 deletions

File tree

include/linux/interrupt.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,6 @@ static inline void init_irq_proc(void)
871871
}
872872
#endif
873873

874-
#ifdef CONFIG_IRQ_TIMINGS
875-
void irq_timings_enable(void);
876-
void irq_timings_disable(void);
877-
u64 irq_timings_next_event(u64 now);
878-
#endif
879-
880874
struct seq_file;
881875
int show_interrupts(struct seq_file *p, void *v);
882876
int arch_show_interrupts(struct seq_file *p, int prec);

kernel/irq/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ config GENERIC_MSI_IRQ
9292
config IRQ_MSI_IOMMU
9393
bool
9494

95-
config IRQ_TIMINGS
96-
bool
97-
9895
config GENERIC_IRQ_MATRIX_ALLOCATOR
9996
bool
10097

kernel/irq/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22

33
obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o kexec.o
4-
obj-$(CONFIG_IRQ_TIMINGS) += timings.o
5-
ifeq ($(CONFIG_TEST_IRQ_TIMINGS),y)
6-
CFLAGS_timings.o += -DDEBUG
7-
endif
84
obj-$(CONFIG_GENERIC_IRQ_CHIP) += generic-chip.o
95
obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
106
obj-$(CONFIG_IRQ_DOMAIN) += irqdomain.o

kernel/irq/handle.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc)
188188
unsigned int irq = desc->irq_data.irq;
189189
struct irqaction *action;
190190

191-
record_irq_time(desc);
192-
193191
for_each_action_of_desc(desc, action) {
194192
irqreturn_t res;
195193

kernel/irq/internals.h

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -288,116 +288,6 @@ static inline void
288288
irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action) { }
289289
#endif
290290

291-
#ifdef CONFIG_IRQ_TIMINGS
292-
293-
#define IRQ_TIMINGS_SHIFT 5
294-
#define IRQ_TIMINGS_SIZE (1 << IRQ_TIMINGS_SHIFT)
295-
#define IRQ_TIMINGS_MASK (IRQ_TIMINGS_SIZE - 1)
296-
297-
/**
298-
* struct irq_timings - irq timings storing structure
299-
* @values: a circular buffer of u64 encoded <timestamp,irq> values
300-
* @count: the number of elements in the array
301-
*/
302-
struct irq_timings {
303-
u64 values[IRQ_TIMINGS_SIZE];
304-
int count;
305-
};
306-
307-
DECLARE_PER_CPU(struct irq_timings, irq_timings);
308-
309-
extern void irq_timings_free(int irq);
310-
extern int irq_timings_alloc(int irq);
311-
312-
static inline void irq_remove_timings(struct irq_desc *desc)
313-
{
314-
desc->istate &= ~IRQS_TIMINGS;
315-
316-
irq_timings_free(irq_desc_get_irq(desc));
317-
}
318-
319-
static inline void irq_setup_timings(struct irq_desc *desc, struct irqaction *act)
320-
{
321-
int irq = irq_desc_get_irq(desc);
322-
int ret;
323-
324-
/*
325-
* We don't need the measurement because the idle code already
326-
* knows the next expiry event.
327-
*/
328-
if (act->flags & __IRQF_TIMER)
329-
return;
330-
331-
/*
332-
* In case the timing allocation fails, we just want to warn,
333-
* not fail, so letting the system boot anyway.
334-
*/
335-
ret = irq_timings_alloc(irq);
336-
if (ret) {
337-
pr_warn("Failed to allocate irq timing stats for irq%d (%d)",
338-
irq, ret);
339-
return;
340-
}
341-
342-
desc->istate |= IRQS_TIMINGS;
343-
}
344-
345-
extern void irq_timings_enable(void);
346-
extern void irq_timings_disable(void);
347-
348-
DECLARE_STATIC_KEY_FALSE(irq_timing_enabled);
349-
350-
/*
351-
* The interrupt number and the timestamp are encoded into a single
352-
* u64 variable to optimize the size.
353-
* 48 bit time stamp and 16 bit IRQ number is way sufficient.
354-
* Who cares an IRQ after 78 hours of idle time?
355-
*/
356-
static inline u64 irq_timing_encode(u64 timestamp, int irq)
357-
{
358-
return (timestamp << 16) | irq;
359-
}
360-
361-
static inline int irq_timing_decode(u64 value, u64 *timestamp)
362-
{
363-
*timestamp = value >> 16;
364-
return value & U16_MAX;
365-
}
366-
367-
static __always_inline void irq_timings_push(u64 ts, int irq)
368-
{
369-
struct irq_timings *timings = this_cpu_ptr(&irq_timings);
370-
371-
timings->values[timings->count & IRQ_TIMINGS_MASK] =
372-
irq_timing_encode(ts, irq);
373-
374-
timings->count++;
375-
}
376-
377-
/*
378-
* The function record_irq_time is only called in one place in the
379-
* interrupts handler. We want this function always inline so the code
380-
* inside is embedded in the function and the static key branching
381-
* code can act at the higher level. Without the explicit
382-
* __always_inline we can end up with a function call and a small
383-
* overhead in the hotpath for nothing.
384-
*/
385-
static __always_inline void record_irq_time(struct irq_desc *desc)
386-
{
387-
if (!static_branch_likely(&irq_timing_enabled))
388-
return;
389-
390-
if (desc->istate & IRQS_TIMINGS)
391-
irq_timings_push(local_clock(), irq_desc_get_irq(desc));
392-
}
393-
#else
394-
static inline void irq_remove_timings(struct irq_desc *desc) {}
395-
static inline void irq_setup_timings(struct irq_desc *desc,
396-
struct irqaction *act) {};
397-
static inline void record_irq_time(struct irq_desc *desc) {}
398-
#endif /* CONFIG_IRQ_TIMINGS */
399-
400-
401291
#ifdef CONFIG_GENERIC_IRQ_CHIP
402292
void irq_init_generic_chip(struct irq_chip_generic *gc, const char *name,
403293
int num_ct, unsigned int irq_base,

kernel/irq/manage.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,8 +1778,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
17781778
chip_bus_sync_unlock(desc);
17791779
mutex_unlock(&desc->request_mutex);
17801780

1781-
irq_setup_timings(desc, new);
1782-
17831781
wake_up_and_wait_for_irq_thread_ready(desc, new);
17841782
wake_up_and_wait_for_irq_thread_ready(desc, new->secondary);
17851783

@@ -1950,7 +1948,6 @@ static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id)
19501948

19511949
irq_release_resources(desc);
19521950
chip_bus_sync_unlock(desc);
1953-
irq_remove_timings(desc);
19541951
}
19551952

19561953
mutex_unlock(&desc->request_mutex);

0 commit comments

Comments
 (0)