lkml.org 
[lkml]   [2008]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/3 v2] proc: Export statistics for softirq to /proc
Date
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;
> }




\
 
 \ /
  Last update: 2008-11-26 11:13    [W:0.152 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site