linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] irq: Skip printing irq when desc->action is null even if any_count is not zero
@ 2020-01-21 13:09 l00520965
  2020-01-22 12:42 ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: l00520965 @ 2020-01-21 13:09 UTC (permalink / raw)
  To: tglx; +Cc: linfeilong, hushiyuan, LiuChao, linux-kernel

From: LiuChao <liuchao173@huawei.com>

When desc->action is empty, there is no need to print out the irq and its'
count in each cpu. The desc is not alloced in request_irq or freed in
free_irq. So some PCI devices, such as rtl8139, uses request_irq and
free_irq, which only modify the action of desc. So /proc/interrupts could
be like this:

           CPU0       CPU1
  2:      69397      69267     GICv3  27 Level     arch_timer
  4:          0          0     GICv3  33 Level     uart-pl011
 38:         46          0     GICv3  36 Level     ehci_hcd:usb1
 39:         66          0     GICv3  37 Level
 40:          0          0     GICv3  38 Level     virtio1
 42:          0          0     GICv3  23 Level     arm-pmu
 43:          0          0  ARMH0061:00   3 Edge      ACPI:Event
 44:          1          0   ITS-MSI 32768 Edge      PCIe PME, pciehp
 45:          0          0   ITS-MSI 32769 Edge      aerdrv

Irqbalance gets the list of interrupts according to /proc/interrupts. In
this case, irqbalance does not remove the interrupt from the balance list,
and the last string in this line,which is Level, is used as irq_name.

Or we can clear desc->kstat_irqs in each cpu in free_irq when desc->action
is null?

Signed-off-by: LiuChao <liuchao173@huawei.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
---
 kernel/irq/proc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index cfc4f088a0e7..b27169e587f4 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -439,7 +439,7 @@ int show_interrupts(struct seq_file *p, void *v)
 {
 	static int prec;
 
-	unsigned long flags, any_count = 0;
+	unsigned long flags;
 	int i = *(loff_t *) v, j;
 	struct irqaction *action;
 	struct irq_desc *desc;
@@ -466,11 +466,7 @@ int show_interrupts(struct seq_file *p, void *v)
 	if (!desc)
 		goto outsparse;
 
-	if (desc->kstat_irqs)
-		for_each_online_cpu(j)
-			any_count |= *per_cpu_ptr(desc->kstat_irqs, j);
-
-	if ((!desc->action || irq_desc_is_chained(desc)) && !any_count)
+	if (!desc->action || irq_desc_is_chained(desc))
 		goto outsparse;
 
 	seq_printf(p, "%*d: ", prec, i);
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-23 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 13:09 [RFC] irq: Skip printing irq when desc->action is null even if any_count is not zero l00520965
2020-01-22 12:42 ` Thomas Gleixner
2020-01-22 19:28   ` Neil Horman
2020-01-23  2:06     ` 答复: " liuchao (CR)
2020-01-23 12:34       ` Thomas Gleixner
2020-01-23 21:40         ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).