From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Keika Kobayashi <kobayashi.kk@ncos.nec.co.jp>
Cc: kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, h-shimamoto@ct.jp.nec.com
Subject: Re: [PATCH 2/3 v2] proc: Export statistics for softirq to /proc
Date: Wed, 26 Nov 2008 19:10:28 +0900 (JST) [thread overview]
Message-ID: <20081126190603.3CC3.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20081121202708.95ec8b3f.kobayashi.kk@ncos.nec.co.jp>
nit
> @@ -49,6 +50,10 @@ static int show_stat(struct seq_file *p, void *v)
> sum += kstat_irqs_cpu(j, i);
>
> sum += arch_irq_stat_cpu(i);
> +
> + for (j = 0; j < NR_SOFTIRQS; j++)
> + sum_softirq += kstat_softirqs_cpu(j, i);
> +
> }
You can calcurate per_irq_sum here.
Typically, # of possible cpu are very big.
So, I don't like unnecessary twrice looping.
> sum += arch_irq_stat();
>
> @@ -111,6 +116,18 @@ static int show_stat(struct seq_file *p, void *v)
> nr_running(),
> nr_iowait());
>
> + seq_printf(p, "softirq %llu", (unsigned long long)sum_softirq);
> +
> + for (i = 0; i < NR_SOFTIRQS; i++) {
> + per_irq_sum = 0;
> +
> + for_each_possible_cpu(j)
> + per_irq_sum += kstat_softirqs_cpu(i, j);
> +
> + seq_printf(p, " %u", per_irq_sum);
> + }
> + seq_printf(p, "\n");
> +
> return 0;
> }
next prev parent reply other threads:[~2008-11-26 10:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-22 4:22 [PATCH 0/3 v2] softirq: Statistics for softirq Keika Kobayashi
2008-11-22 4:25 ` [PATCH 1/3 v2] softirq: Introduce statistics " Keika Kobayashi
2008-11-22 5:36 ` KOSAKI Motohiro
2008-11-24 23:46 ` Keika Kobayashi
2008-11-26 10:14 ` KOSAKI Motohiro
2008-11-22 4:27 ` [PATCH 2/3 v2] proc: Export statistics for softirq to /proc Keika Kobayashi
2008-11-22 11:36 ` Eric Dumazet
2008-11-26 10:10 ` KOSAKI Motohiro [this message]
2009-01-09 22:16 ` Andrew Morton
2009-01-10 18:22 ` kobayashi.kk
2009-01-10 19:44 ` KOSAKI Motohiro
2009-01-12 11:46 ` KOSAKI Motohiro
2009-01-12 23:53 ` kobayashi.kk
2008-11-22 4:28 ` [PATCH 3/3 v2] proc: Update document for /proc/softirqs and /proc/stat Keika Kobayashi
2008-11-26 10:11 ` KOSAKI Motohiro
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=20081126190603.3CC3.KOSAKI.MOTOHIRO@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=h-shimamoto@ct.jp.nec.com \
--cc=kobayashi.kk@ncos.nec.co.jp \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®