From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ilvokhin.com (mail.ilvokhin.com [178.62.254.231]) (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 62CAA3E123F for ; Mon, 9 Mar 2026 15:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.62.254.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773071948; cv=none; b=EnPw2PoIen3S4gJEXppurqJkMqfNTdqxvhdgytmjp4mcVjhfLYSaOxJPe7StpaIq1JvDAlH5ktejEqp9j5CrwQTcoteCdKPJwBgu+eLC7/apgcc57TAIpAPQSwlqjvf1ikJH5komX7IEHmuFstOyUHTNe5HR6aYZAe9T99Hl/9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773071948; c=relaxed/simple; bh=CN1bgpKfAje5DK1MqLJZ82Hj8uyAvRN5vY2Ml9V0GOo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rE2/fTG+bd/vRoURWksWF/MuRFjXVrZeeBmI9xFZEZD1Y+lXv2ZeQOLnvZ8mPXwbz8CEne+zQ9hTIMOfDupnIe0okxIi/0/xZqI6wjqt9PG1r0DtYv9cCb+eKC8IATFxc1sfU3zEwISztri5LqwKS32yxlkPOq1yPzSTiDv3E9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com; spf=pass smtp.mailfrom=ilvokhin.com; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b=Zjaavlxo; arc=none smtp.client-ip=178.62.254.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b="Zjaavlxo" Received: from shell.ilvokhin.com (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id 96007B36EC; Mon, 09 Mar 2026 15:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1773071945; bh=TX2n26/AvaY7dcmKFv0Uyd+cwtFfSRkvz8EBhsnypG0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Zjaavlxox1enU9TwzTJlJNzx3BAvr8DnWBRn556t56QNDqUK3YfVc2QynMNHRQPrZ BvFNAiNn0sO7oGbeIbwSO4KAq84FoSOWuib7q3PPwpxb0wOhegqgRvB9ljrMfzXCJX 14OCWEdFMotA/iTGvxI7lLscG7UuJtwBDQIFj8b4= Date: Mon, 9 Mar 2026 15:59:04 +0000 From: Dmitry Ilvokhin To: Thomas Gleixner Cc: LKML , x86@kernel.org, Neil Horman Subject: Re: [patch 02/14] genirq/proc: Avoid formatting zero counts in /proc/interrupts Message-ID: References: <20260303150539.513068586@kernel.org> <20260303154548.082654896@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260303154548.082654896@kernel.org> On Wed, Mar 04, 2026 at 07:55:36PM +0100, Thomas Gleixner wrote: > A large portion of interrupt count entries are zero. There is no point in > formatting the zero value as it is way cheeper to just emit a constant > string. > > Collect the number of consecutive zero counts and emit them in one go > before a non-zero count and at the end of the line. > > Signed-off-by: Thomas Gleixner > --- > include/linux/interrupt.h | 1 + > kernel/irq/proc.c | 42 +++++++++++++++++++++++++++++++++++++----- > 2 files changed, 38 insertions(+), 5 deletions(-) > > --- a/include/linux/interrupt.h > +++ b/include/linux/interrupt.h > @@ -864,6 +864,7 @@ static inline void init_irq_proc(void) > struct seq_file; > int show_interrupts(struct seq_file *p, void *v); > int arch_show_interrupts(struct seq_file *p, int prec); > +void irq_proc_emit_counts(struct seq_file *p, unsigned int __percpu *cnts); > > extern int early_irq_init(void); > extern int arch_probe_nr_irqs(void); > --- a/kernel/irq/proc.c > +++ b/kernel/irq/proc.c > @@ -450,6 +450,42 @@ int __weak arch_show_interrupts(struct s > # define ACTUAL_NR_IRQS irq_get_nr_irqs() > #endif > > +#define ZSTR1 " 0" > +#define ZSTR1_LEN 11 Nit: ZSTR1_LEN could be derived from ZSTR1 to avoid a silent mismatch if the string is ever changed (which is unlikely, but still). #define ZSTR1_LEN (sizeof(ZSTR1) - 1) Reviewed-by: Dmitry Ilvokhin