All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Waiman Long <longman@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	linux-fsdevel@vger.kernel.org,
	Davidlohr Bueso <dave@stgolabs.net>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Daniel Colascione <dancol@google.com>,
	Dave Chinner <david@fromorbit.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [patch 2/2] proc/stat: Make the interrupt statistics more efficient
Date: Thu, 31 Jan 2019 00:24:43 +0300	[thread overview]
Message-ID: <20190130212443.GA15533@avx2> (raw)
In-Reply-To: <20190130123615.592071954@linutronix.de>

On Wed, Jan 30, 2019 at 01:31:32PM +0100, Thomas Gleixner wrote:
> +static void show_irq_gap(struct seq_file *p, int gap)
> +{
> +	static const char zeros[] = " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0";
> +
> +	while (gap > 0) {
> +		int inc = min_t(int, gap, ARRAY_SIZE(zeros) / 2);
> +
> +		seq_write(p, zeros, 2 * inc);
> +		gap -= inc;
> +	}
> +}
> +
> +static void show_all_irqs(struct seq_file *p)
> +{
> +	int i, next = 0;
> +
> +	for_each_active_irq(i) {
> +		show_irq_gap(p, i - next);
> +		seq_put_decimal_ull(p, " ", kstat_irqs_usr(i));
> +		next = i + 1;
> +	}
> +	show_irq_gap(p, nr_irqs - next);
> +}

Every signed int can and should be unsigned int in this patch.

  reply	other threads:[~2019-01-30 21:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 12:31 [patch 0/2] genirq, proc: Speedup /proc/stat interrupt statistics Thomas Gleixner
2019-01-30 12:31 ` [patch 1/2] genriq: Avoid summation loops for /proc/stat Thomas Gleixner
2019-01-30 16:00   ` Waiman Long
2019-01-30 17:58     ` Thomas Gleixner
2019-01-30 12:31 ` [patch 2/2] proc/stat: Make the interrupt statistics more efficient Thomas Gleixner
2019-01-30 21:24   ` Alexey Dobriyan [this message]
2019-01-30 21:27     ` Thomas Gleixner
2019-01-30 15:46 ` [patch 0/2] genirq, proc: Speedup /proc/stat interrupt statistics Waiman Long
2019-01-30 21:58 ` Andrew Morton
2019-01-30 22:00   ` Thomas Gleixner
2019-01-30 22:09     ` Waiman Long
2019-01-31  3:46     ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190130212443.GA15533@avx2 \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dancol@google.com \
    --cc=dave@stgolabs.net \
    --cc=david@fromorbit.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=marc.zyngier@arm.com \
    --cc=miklos@szeredi.hu \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.