From nobody Thu Apr 2 18:59:16 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2F6C3218B3 for ; Wed, 1 Apr 2026 21:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775080293; cv=none; b=S8D1xqaSfnvMDC7mjpmytGcgrTZz9asJOceFOLQ6FoZ8lKhBRS/u0nhgi8rnBh5Jvsn1C20gnJjqH3w/ap1RSwJl4POyRdGTJcrtn8k5+FfXMwgf0pwbIEirgWIMVoTojbhlz+e6hHMFc40Z2LMLDtZpgZSEffrzb8pr9n7hX8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775080293; c=relaxed/simple; bh=ZtR+x+nc8DhbU1kEi5XIpUNr/GYyYyFihDEucY3btAI=; h=Date:Message-ID:From:To:Cc:Subject; b=uxaWmilPEfoVGjlzr02Q0iho6uFmt9++IXr9KfsElwaM52KrqgqMUbKJ5m3dMptpmuLsxa+fFqbm+GsSaXc97M6evl+7lqwGT0rleQKvPKVUI+i3tps/ytDFMiqsIt589fUKbvPKzKkk2sp6mnWIamDVz1nEk00MqyhZiSOGG9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XQK//fD9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XQK//fD9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A756C4CEF7; Wed, 1 Apr 2026 21:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775080292; bh=ZtR+x+nc8DhbU1kEi5XIpUNr/GYyYyFihDEucY3btAI=; h=Date:From:To:Cc:Subject:From; b=XQK//fD92cVSVGv+qbb6KvCVqbGduXCnCmtJmE3iT4kd5zw29B2BUSkz+77e6D07Y 1hNOZGXNNbPHAVL9f0CuCWXHuiYFEBaE2ElG6mTtotxzXs1ySUvB2P1r4usTv7G+8v NRB4lP/0Jpj0SHHOg43iORjOUE4ysvKvnxTAlEotJx0STYK3hbtLEmAEdxO08WLyND 05AIiATssITn9wmVoXzFIi5BbfjelyTr2PQzIqCPezkMnxtsSBWkDEZSFUzft0ekGp 9sSgLcwhQUcRqAjibJXfGEfCgasrmcFA8q/niUTOKABfwQbKUADeXl6sbiRHFE+GYC vmZgIEQr43KDg== Date: Wed, 01 Apr 2026 23:51:28 +0200 Message-ID: <20260401195625.213446764@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Michael Kelley , Dmitry Ilvokhin , Radu Rendec , Jan Kiszka , Kieran Bingham , Florian Fainelli , Marc Zyngier Subject: [patch V5 00/15] Improve /proc/interrupts further Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is a follow up to v4 which can be found here: https://lore.kernel.org/20260331071453.172185305@kernel.org The v1 cover letter contains a full analysis, explanation and numbers: https://lore.kernel.org/20260303150539.513068586@kernel.org TLDR: - The performance of reading of /proc/interrupts has been improved piecewise over the years, but most of the low hanging fruit has been left on the table. Changes vs. V4: - Moved the header printing ahead of the architecture and update comment - Dmitry - Fix the gdbscript so it works with a bitmap larger than one entry and bring show_irq_err_count() back as it's required by MIPS - Removed unused variable and resort hunks so it's bisectable. Delta patch against v4 is below. The series applies on top of v7.0-rc3 and is also available via git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq-proc-v5 Thanks, tglx --- diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index ae8b06e01948..7eb07e3bdb4c 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -2066,7 +2066,6 @@ static const void *__cleanup_nmi(unsigned int irq, st= ruct irq_desc *desc) const void *free_nmi(unsigned int irq, void *dev_id) { struct irq_desc *desc =3D irq_to_desc(irq); - void *ret; =20 if (!desc || WARN_ON(!irq_is_nmi(desc))) return NULL; diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index a62d4694f063..3bd394aa7617 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -540,10 +540,7 @@ static int irq_seq_show(struct seq_file *p, void *v) struct irq_desc *desc =3D v; struct irqaction *action; =20 - if (desc =3D=3D ARCH_PROC_IRQDESC) - return arch_show_interrupts(p, constr->num_prec); - - /* print header for the first interrupt indicated by !p>private */ + /* Print header for the first interrupt? */ if (constr->print_header) { unsigned int cpu; =20 @@ -554,6 +551,9 @@ static int irq_seq_show(struct seq_file *p, void *v) constr->print_header =3D false; } =20 + if (desc =3D=3D ARCH_PROC_IRQDESC) + return arch_show_interrupts(p, constr->num_prec); + seq_put_decimal_ull_width(p, "", irq_desc_get_irq(desc), constr->num_prec= ); seq_putc(p, ':'); =20 @@ -617,9 +617,9 @@ static void *irq_seq_next_desc(loff_t *pos) if (desc) { *pos =3D irq_desc_get_irq(desc); /* - * If valid for output try to acquire a reference count - * on the descriptor so that it can't be freed after - * dropping RCU read lock on return. + * If valid for output then try to acquire a reference + * count on the descriptor so that it can't be freed + * after dropping RCU read lock on return. */ if (irq_settings_proc_valid(desc) && irq_desc_get_ref(desc)) return desc; diff --git a/scripts/gdb/linux/interrupts.py b/scripts/gdb/linux/interrupts= .py index 418f3ece2f0f..cf0a02c8124d 100644 --- a/scripts/gdb/linux/interrupts.py +++ b/scripts/gdb/linux/interrupts.py @@ -103,12 +103,12 @@ def x86_show_interupts(prec): info_type =3D gdb.lookup_type('struct irq_stat_info') info =3D gdb.parse_and_eval('irq_stat_info') bitmap =3D gdb.parse_and_eval('irq_stat_count_show') - nbits =3D 8 * int(bitmap.type.sizeof) + bitsperlong =3D 8 * int(bitmap.type.target().sizeof) =20 text =3D "" for idx in range(int(info.type.sizeof / info_type.sizeof)): - show =3D bitmap[idx / nbits] - if not show & 1 << (idx % nbits): + show =3D bitmap[int(idx / bitsperlong)] + if not show & 1 << int(idx % bitsperlong): continue pfx =3D info[idx]['symbol'].string() desc =3D info[idx]['text'].string() @@ -145,6 +145,13 @@ def aarch64_show_interrupts(prec): text +=3D "%*s: %10lu\n" % (prec, "ERR", gdb.parse_and_eval("irq_err_c= ount")) return text =20 +def show_irq_err_count(prec): + cnt =3D utils.gdb_eval_or_none("irq_err_count") + text =3D "" + if cnt is not None: + text +=3D "%*s: %10u\n" % (prec, "ERR", cnt['counter']) + return text + def arch_show_interrupts(prec): text =3D "" if utils.is_target_arch("x86"):