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-prev] [day] [month] [year] [list]
Message-ID: <171740846466.10875.8507564060524290466.tip-bot2@tip-bot2>
Date: Mon, 03 Jun 2024 09:54:24 -0000
From: "tip-bot2 for Adrian Huang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Adrian Huang <ahuang12@...ovo.com>,
 Jiwei Sun <sunjw10@...ovo.com>, x86@...nel.org, linux-kernel@...r.kernel.org,
 maz@...nel.org
Subject:
 [tip: irq/core] genirq/proc: Simplify irqdesc::kstat_irqs handling further

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     540588772ed0b191969c7902bf90d561ab0035be
Gitweb:        https://git.kernel.org/tip/540588772ed0b191969c7902bf90d561ab0035be
Author:        Adrian Huang <ahuang12@...ovo.com>
AuthorDate:    Wed, 15 May 2024 18:06:32 +08:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Mon, 03 Jun 2024 11:48:29 +02:00

genirq/proc: Simplify irqdesc::kstat_irqs handling further

Interrupts which have no action and chained interrupts can be
ignored due to the following reasons (as per tglx's comment):

  1) Interrupts which have no action are completely uninteresting as
     there is no real information attached.

  2) Chained interrupts do not have a count at all.

So there is no point to evaluate the number of accounted interrupts before
checking for non-requested or chained interrupts.

Remove the any_count logic and simply check whether the interrupt
descriptor has the kstat_irqs member populated.

[ tglx: Adapted to upstream changes ]

Suggested-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Adrian Huang <ahuang12@...ovo.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Jiwei Sun <sunjw10@...ovo.com>
Link: https://lore.kernel.org/r/20240515100632.1419-1-ahuang12@lenovo.com
Link: https://lore.kernel.org/lkml/87h6f0knau.ffs@tglx/
---
 kernel/irq/proc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 5c320c3..8cccdf4 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -461,10 +461,10 @@ int show_interrupts(struct seq_file *p, void *v)
 {
 	static int prec;
 
-	unsigned long flags, any_count = 0;
 	int i = *(loff_t *) v, j;
 	struct irqaction *action;
 	struct irq_desc *desc;
+	unsigned long flags;
 
 	if (i > ACTUAL_NR_IRQS)
 		return 0;
@@ -488,10 +488,7 @@ int show_interrupts(struct seq_file *p, void *v)
 	if (!desc || irq_settings_is_hidden(desc))
 		goto outsparse;
 
-	if (desc->kstat_irqs)
-		any_count = kstat_irqs_desc(desc, cpu_online_mask);
-
-	if ((!desc->action || irq_desc_is_chained(desc)) && !any_count)
+	if (!desc->action || irq_desc_is_chained(desc) || !desc->kstat_irqs)
 		goto outsparse;
 
 	seq_printf(p, "%*d: ", prec, i);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ