From nobody Mon Jun 8 20:43:23 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 A91EC402B87; Tue, 26 May 2026 14:22:38 +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=1779805360; cv=none; b=NeRZumONa5w8hfhAToE4TS1txHSrWpnjnvov2JT+wR8EcxK0OqT/ssU1BkJ2LR9ZI5GWyxV1xpGCZNbxa3582O2S3A444MnAvn076dGG3BCV07cH7GmSPpdZ/hu5VeHBPnFAExzoo+UpMDJrVCYgxW9zG5YU0KdJJQaLueo4+l4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779805360; c=relaxed/simple; bh=QiH72kbU9fviCIzDk6/zthYEPVZyyZI87YKjdPIkz1c=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=P/w9yRwTENK46zbX3tomA4msVVSZTKu7VFMAB/VrPVwpZNWNJjKoiVtshqwt0dTGcYFJCsErZZveN1X6D+gcnO43yVTIptrP85ycVQf8FS/yKbnph3IGv1oiUd+2EG7sP9IZNj8S2LGkuobguxKamy//pI9Pa6ycbDX3cYaxFzY= 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=HV1u1ONU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SbPUZXTq; 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="HV1u1ONU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SbPUZXTq" Date: Tue, 26 May 2026 14:22:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779805357; 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=6ZLLq+4YoCJj56YE8D6m1tFmuzMsVWt7isl/inDZjrQ=; b=HV1u1ONUVp405vTXsQin4oMJBBidT349HfqsueXvnHggCAtA8Tvy+Hw0gJwlWcVX1502WP mQkhBlfbqhnHX/hBqI8oaxnmHhfIttrydDI30uJEzNmZuteBLf8fdVE044f4TjyXIHxxzc hFRTjBADByKQF4cc5aaaIZadw6d3Xbsc/8jGrrCbHhUyqLdcTiClrVOz3FV7RSS1Jbzn7Y CEhx2sIripG58zhsjeXIy95KS+2QNPa7/I5JJp64gUlgH7xUCAv8kCbsmHFwa/nmyjOd1W z4PTFVIbypw6YkDkL6NEsfVXTGlx8Fi0qO9kJUpCVVZwCi2VhjIYQQfNvu/Etg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779805357; 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=6ZLLq+4YoCJj56YE8D6m1tFmuzMsVWt7isl/inDZjrQ=; b=SbPUZXTqVHGALbBwg0p9JGFJHxcRG48yyZG8IUzyohHk352ZI5WfrWiwvVg8ecBIj+nXl0 5Yp3Ey9n6gvo3VBw== 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: Utilize irq_desc::tot_count to avoid evaluation Cc: Thomas Gleixner , Michael Kelley , Dmitry Ilvokhin , Radu Rendec , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20260517194931.115522199@kernel.org> References: <20260517194931.115522199@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177980535576.1039918.15952902822546296347.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: 0179464391af9a01b911f441d2dda42ea253dfbd Gitweb: https://git.kernel.org/tip/0179464391af9a01b911f441d2dda42ea= 253dfbd Author: Thomas Gleixner AuthorDate: Sun, 17 May 2026 22:01:43 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 26 May 2026 16:21:11 +02:00 genirq/proc: Utilize irq_desc::tot_count to avoid evaluation Interrupts which are not marked per CPU increment not only the per CPU statistics, but also the accumulation counter irq_desc::tot_count. Change the counter to type unsigned long so it does not produce sporadic zeros due to wrap arounds on 64-bit machines and do a quick check for non per CPU interrupts. If the counter is zero, then simply emit a full set of zero strings. That spares the evaluation of the per CPU counters completely for interrupts with zero events. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Reviewed-by: Dmitry Ilvokhin Reviewed-by: Radu Rendec Link: https://patch.msgid.link/20260517194931.115522199@kernel.org --- include/linux/irqdesc.h | 6 +++--- kernel/irq/proc.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index dae9a9b..1058786 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h @@ -52,8 +52,8 @@ struct irq_redirect { * @depth: disable-depth, for nested irq_disable() calls * @wake_depth: enable depth, for multiple irq_set_irq_wake() callers * @tot_count: stats field for non-percpu irqs - * @irq_count: stats field to detect stalled irqs * @last_unhandled: aging timer for unhandled count + * @irq_count: stats field to detect stalled irqs * @irqs_unhandled: stats field for spurious unhandled interrupts * @threads_handled: stats field for deferred spurious detection of thread= ed handlers * @threads_handled_last: comparator field for deferred spurious detection= of threaded handlers @@ -87,9 +87,9 @@ struct irq_desc { unsigned int core_internal_state__do_not_mess_with_it; unsigned int depth; /* nested irq disables */ unsigned int wake_depth; /* nested wake enables */ - unsigned int tot_count; - unsigned int irq_count; /* For detecting broken IRQs */ + unsigned long tot_count; unsigned long last_unhandled; /* Aging timer for unhandled count */ + unsigned int irq_count; /* For detecting broken IRQs */ unsigned int irqs_unhandled; atomic_t threads_handled; int threads_handled_last; diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 378b523..5a1805b 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -523,7 +523,16 @@ int show_interrupts(struct seq_file *p, void *v) return 0; =20 seq_printf(p, "%*d:", prec, i); - irq_proc_emit_counts(p, &desc->kstat_irqs->cnt); + + /* + * Always output per CPU interrupts. Output device interrupts only when + * desc::tot_count is not zero. + */ + if (irq_settings_is_per_cpu(desc) || irq_settings_is_per_cpu_devid(desc) = || + data_race(desc->tot_count)) + irq_proc_emit_counts(p, &desc->kstat_irqs->cnt); + else + irq_proc_emit_zero_counts(p, num_online_cpus()); seq_putc(p, ' '); =20 guard(raw_spinlock_irq)(&desc->lock);