lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200121130959.22589-1-liuchao173@huawei.com>
Date:   Tue, 21 Jan 2020 21:09:59 +0800
From:   l00520965 <liuchao173@...wei.com>
To:     <tglx@...utronix.de>
CC:     <linfeilong@...wei.com>, <hushiyuan@...wei.com>,
        LiuChao <liuchao173@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [RFC] irq: Skip printing irq when desc->action is null even if any_count is not zero

From: LiuChao <liuchao173@...wei.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@...wei.com>
Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ