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] [thread-next>] [day] [month] [year] [list]
Date: Mon, 13 May 2024 20:05:47 +0800
From: Adrian Huang <adrianhuang0701@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org,
	Jiwei Sun <sunjw10@...ovo.com>,
	Adrian Huang <ahuang12@...ovo.com>
Subject: [PATCH 1/2] genirq/proc: Try to jump over the unallocated irq hole whenever possible

From: Adrian Huang <ahuang12@...ovo.com>

Current approach blindly iterates the irq number until the number is
greater than 'nr_irqs', and checks if each irq is allocated. It is
inefficient if the big hole (the last allocated irq number to nr_irqs)
is available in the system.

The solution is to try jumping over the unallocated irq hole when an
unallocated irq is detected.

Tested-by: Jiwei Sun <sunjw10@...ovo.com>
Signed-off-by: Adrian Huang <ahuang12@...ovo.com>
---
 fs/proc/interrupts.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c
index cb0edc7cbf09..111ea8a3c553 100644
--- a/fs/proc/interrupts.c
+++ b/fs/proc/interrupts.c
@@ -19,6 +19,12 @@ static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
 	(*pos)++;
 	if (*pos > nr_irqs)
 		return NULL;
+
+	rcu_read_lock();
+	if (!irq_to_desc(*pos))
+		*pos = irq_get_next_irq(*pos);
+	rcu_read_unlock();
+
 	return pos;
 }
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ