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]
Message-ID: <CAHKZfL1xq-pemEMo7m8DctEVxSG_ASQWxCC_HsN=-92UAjP_Mw@mail.gmail.com>
Date: Tue, 26 Mar 2024 21:35:17 +0800
From: Huang Adrian <adrianhuang0701@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Jiwei Sun <sunjw10@...ovo.com>, 
	Adrian Huang <ahuang12@...ovo.com>
Subject: Re: [PATCH 1/1] genirq/proc: Try to jump over the unallocated irq
 hole whenever possible

On Tue, Mar 26, 2024 at 6:32 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> Why are you not handling it at the place where the seq_file position is
> iterated instead of doing this + 1 - 1 game here and getting the next
> number only when you already ran into the hole?

Thanks for the comments.

Yes, I did think about the changes in int_seq_next().

The reason I made the changes in show_interrupts() is to minimize the
traversal times of the 'sparse_irqs' maple tree since irq_to_desc() is
invoked in show_interrupts().

Does the following patch meet your expectations? If yes, I'll submit
it for review.

Thanks.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ