From nobody Mon Jun 8 20:43:22 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 6B8653FE67A; Tue, 26 May 2026 14:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779805349; cv=none; b=uEtR5TZkJnQXH0dnzIX+p4QgNBdfEiGdY1Mgi1fVCXLU29VtPZqzplUXgxCl+8saFH9eAdDiEQty9iJ+10tqvAt6ZIUDgZ/USLEVGbyIi72hRYoA1CulqEQtGQxuMoAo3vj59IB0F6NrEM4NEtOtbbbecYG7E52s/kg0sn0p5qU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779805349; c=relaxed/simple; bh=GSq4v/pMp2sRyczRyX4zQ7ovWKGTkUBmfnBLgl1EfbI=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=MyADn6PC5DUI7L/JCs0GRGIec6DmOREbhAA0ezaSMUfnMOJvXa4w1hFpB2nc8fLVzLk/q7s/T7+MiJLTb8QyBsFxmR9Q+otSwOfXHL4IZSNs7Gq1r+jJ4lHKu6YpTCcKARakdI+8r7IhbQyvGzuqmZOF0S1sQw4xFFJlc8rpmJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=B9sYa0iF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=GXCh2nOS; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="B9sYa0iF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GXCh2nOS" Date: Tue, 26 May 2026 14:22:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779805345; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=voSboEIwEXFCAPnEnesaOD5KXdPEoJ1Wf+eYCow4gfU=; b=B9sYa0iFtycCCr3YzcgAsVzAgUDKXrwcBoCFao9tkNbKkzFcd4CZH+oyOPBkRAgEb19UMo DiJFbhZI0uIq+4sFCxURidHPUAvRR6+YIHOpWHyFHUkTZsW+UZMM9Fs9WY7k7DIIgVM4Fh aP0aP0IZABh0pBtVomgLbkoVayJE1fHN6EV/Sq41lUGuB4Q6yI312Y9ANhoBLHJBSJDOrR Yi3bqA6z6Qb/6wpKRSzTAjbdyxINNK5ouKg4iylM1CBrJsPqw7dbUBAG7kbSIrwpEaWuYA 7v3l4S512y28WtzclGPXIoBNiK3wXvM0vNrW27li2XtkL86PMDR8T+h7oljZfw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779805345; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=voSboEIwEXFCAPnEnesaOD5KXdPEoJ1Wf+eYCow4gfU=; b=GXCh2nOSKb+66edKDlNBBMK2ISV1RY4iTDz/Xzwui5fPQ4pWjjEIeyAW1GuVMFqHnGSIYd A+c9ej+us3g/i7CQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] genirq/proc: Increase default interrupt number precision to four Cc: Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20260517194931.839482411@kernel.org> References: <20260517194931.839482411@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177980534375.1039918.2291758374617639184.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/core branch of tip: Commit-ID: 34594da7650d3ea67f96c0f4034ff6b2453f67c3 Gitweb: https://git.kernel.org/tip/34594da7650d3ea67f96c0f4034ff6b24= 53f67c3 Author: Thomas Gleixner AuthorDate: Sun, 17 May 2026 22:02:29 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 26 May 2026 16:21:14 +02:00 genirq/proc: Increase default interrupt number precision to four Quite some architectures have four character wide acronyms for architecture specific interrupts like IPI, NMI, etc. The default precision of printing the Linux device interrupt numbers is three, which causes quite some code to play games with adding or omitting space after the acronym and the colon in order to keep the per CPU numbers properly aligned. Increase the default number precision to four in the core code and get rid of the space games all over the place. At the same time align all architecture specific descriptor texts left so that they show up in the same column as the interrupt chip names, which makes the output more uniform accross architectures. Fix up the GDB script to this new scheme as well. Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260517194931.839482411@kernel.org --- arch/alpha/kernel/irq.c | 8 ++++---- arch/arm/kernel/smp.c | 3 +-- arch/arm64/kernel/smp.c | 5 ++--- arch/loongarch/kernel/smp.c | 2 +- arch/riscv/kernel/smp.c | 3 +-- arch/sh/kernel/irq.c | 2 +- arch/sparc/kernel/irq_32.c | 12 ++++++------ arch/sparc/kernel/irq_64.c | 4 ++-- arch/um/kernel/irq.c | 4 ++-- arch/xtensa/kernel/irq.c | 2 +- kernel/irq/proc.c | 4 ++-- scripts/gdb/linux/interrupts.py | 16 ++++++---------- 12 files changed, 29 insertions(+), 36 deletions(-) diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index c67047c..4a6a8b1 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -72,16 +72,16 @@ int arch_show_interrupts(struct seq_file *p, int prec) int j; =20 #ifdef CONFIG_SMP - seq_puts(p, "IPI: "); + seq_puts(p, " IPI: "); for_each_online_cpu(j) seq_printf(p, "%10lu ", cpu_data[j].ipi_count); seq_putc(p, '\n'); #endif - seq_puts(p, "PMI: "); + seq_puts(p, " PMI: "); for_each_online_cpu(j) seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j)); - seq_puts(p, " Performance Monitoring\n"); - seq_printf(p, "ERR: %10lu\n", irq_err_count); + seq_puts(p, " Performance Monitoring\n"); + seq_printf(p, " ERR: %10lu\n", irq_err_count); return 0; } =20 diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 4e8e89a..b5fb469 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -551,8 +551,7 @@ void show_ipi_list(struct seq_file *p, int prec) if (!ipi_desc[i]) continue; =20 - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, - prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u:", prec - 1, "IPI", i); =20 for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu)); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 1aa3241..1d0e0e6 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -833,11 +833,10 @@ int arch_show_interrupts(struct seq_file *p, int prec) unsigned int cpu, i; =20 for (i =3D 0; i < MAX_IPI; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, - prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u: ", prec - 1, "IPI", i); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_desc_kstat_cpu(get_ipi_desc(cpu, i), cpu)); - seq_printf(p, " %s\n", ipi_types[i]); + seq_printf(p, " %s\n", ipi_types[i]); } =20 seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count); diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c index 64a048f..5092261 100644 --- a/arch/loongarch/kernel/smp.c +++ b/arch/loongarch/kernel/smp.c @@ -88,7 +88,7 @@ void show_ipi_list(struct seq_file *p, int prec) unsigned int cpu, i; =20 for (i =3D 0; i < NR_IPI; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u:", prec - 1, "IPI", i); for_each_online_cpu(cpu) seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat, cpu).ipi_irqs[i], 1= 0); seq_printf(p, " LoongArch %d %s\n", i + 1, ipi_types[i]); diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 5ed5095..fa66f9c 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -226,8 +226,7 @@ void show_ipi_stats(struct seq_file *p, int prec) unsigned int cpu, i; =20 for (i =3D 0; i < IPI_MAX; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, - prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u:", prec - 1, "IPI", i); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu)); seq_printf(p, " %s\n", ipi_names[i]); diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 9022d8a..03c39b5 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -46,7 +46,7 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat.__nmi_count, j), 10); - seq_printf(p, " Non-maskable interrupts\n"); + seq_printf(p, " Non-maskable interrupts\n"); =20 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); =20 diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index 5210991..22db727 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c @@ -199,19 +199,19 @@ int arch_show_interrupts(struct seq_file *p, int prec) int j; =20 #ifdef CONFIG_SMP - seq_printf(p, "RES:"); + seq_printf(p, "%*s:", prec, "RES"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).irq_resched_count, 10); - seq_printf(p, " IPI rescheduling interrupts\n"); - seq_printf(p, "CAL:"); + seq_printf(p, " IPI rescheduling interrupts\n"); + seq_printf(p, "%*s:", prec, "CAL"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).irq_call_count, 10); - seq_printf(p, " IPI function call interrupts\n"); + seq_printf(p, " IPI function call interrupts\n"); #endif - seq_printf(p, "NMI:"); + seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).counter, 10); - seq_printf(p, " Non-maskable interrupts\n"); + seq_printf(p, " Non-maskable interrupts\n"); return 0; } =20 diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index c5466a9..3f55c69 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c @@ -303,10 +303,10 @@ int arch_show_interrupts(struct seq_file *p, int prec) { int j; =20 - seq_printf(p, "NMI:"); + seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).__nmi_count, 10); - seq_printf(p, " Non-maskable interrupts\n"); + seq_printf(p, " Non-maskable interrupts\n"); return 0; } =20 diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 5929d49..ddfd6e9 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -716,12 +716,12 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%*s: ", prec, "RES"); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_stats(cpu)->irq_resched_count); - seq_puts(p, " Rescheduling interrupts\n"); + seq_puts(p, " Rescheduling interrupts\n"); =20 seq_printf(p, "%*s: ", prec, "CAL"); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_stats(cpu)->irq_call_count); - seq_puts(p, " Function call interrupts\n"); + seq_puts(p, " Function call interrupts\n"); #endif =20 return 0; diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index b1e410f..6f01f53 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c @@ -59,7 +59,7 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(cpu) seq_printf(p, " %10lu", per_cpu(nmi_count, cpu)); - seq_puts(p, " Non-maskable interrupts\n"); + seq_puts(p, " Non-maskable interrupts\n"); #endif return 0; } diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index c635fb6..1cb47a8 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -460,7 +460,7 @@ int __weak arch_show_interrupts(struct seq_file *p, int= prec) static struct irq_proc_constraints { unsigned int num_prec; } irq_proc_constraints __read_mostly =3D { - .num_prec =3D 3, + .num_prec =3D 4, }; =20 #ifndef ACTUAL_NR_IRQS @@ -471,7 +471,7 @@ void irq_proc_calc_prec(void) { unsigned int prec, n; =20 - for (prec =3D 3, n =3D 1000; prec < 10 && n <=3D total_nr_irqs; ++prec) + for (prec =3D 4, n =3D 10000; prec < 10 && n <=3D total_nr_irqs; ++prec) n *=3D 10; WRITE_ONCE(irq_proc_constraints.num_prec, prec); } diff --git a/scripts/gdb/linux/interrupts.py b/scripts/gdb/linux/interrupts= .py index a4e25d2..e967343 100644 --- a/scripts/gdb/linux/interrupts.py +++ b/scripts/gdb/linux/interrupts.py @@ -131,23 +131,19 @@ def arm_common_show_interrupts(prec): if nr_ipi is None or ipi_desc is None or ipi_types is None: return text =20 - if prec >=3D 4: - sep =3D " " - else: - sep =3D "" - for ipi in range(nr_ipi): - text +=3D "%*s%u:%s" % (prec - 1, "IPI", ipi, sep) + text +=3D "%*s%u: " % (prec - 1, "IPI", ipi) desc =3D ipi_desc[ipi].cast(irq_desc_type.get_type().pointer()) if desc =3D=3D 0: continue for cpu in cpus.each_online_cpu(): - text +=3D "%10u" % (cpus.per_cpu(desc['kstat_irqs'], cpu)['cnt= ']) - text +=3D " %s" % (ipi_types[ipi].string()) + text +=3D "%10u " % (cpus.per_cpu(desc['kstat_irqs'], cpu)['cn= t']) + text +=3D "%s" % (ipi_types[ipi].string()) text +=3D "\n" return text =20 def aarch64_show_interrupts(prec): + # Does not work for ARM64 as "ipi_desc" is not available there text =3D arm_common_show_interrupts(prec) text +=3D "%*s: %10lu\n" % (prec, "ERR", gdb.parse_and_eval("irq_err_c= ount")) return text @@ -175,8 +171,8 @@ class LxInterruptList(gdb.Command): =20 def invoke(self, arg, from_tty): nr_irqs =3D gdb.parse_and_eval("total_nr_irqs") - prec =3D 3 - j =3D 1000 + prec =3D 4 + j =3D 10000 while prec < 10 and j <=3D nr_irqs: prec +=3D 1 j *=3D 10