Re: [PATCH] proc/softirqs: only show state for online cpus

From: Yong Zhang
Date: Tue Jul 26 2011 - 02:14:48 EST


2011/7/26 KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>:
>> Like /proc/interrupts, no need to output data for nobody.
>>
>> Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
>> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>> Cc: Keika Kobayashi <kobayashi.kk@xxxxxxxxxxxxxx>
>> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
>
> If the cpu never be onlined, its statistics always 0. Then, it definitely

Yeah, so your screen may contain noise.

> no value. In the other hand, if the cpu was offlined dynamically, we don't
> know the user want to know the cpus's statistics or not.

Same to /proc/interrupts :)

IMHO, if user want to check the value of offline-cpu, maybe that means
he want to check the state of the whole system, /proc/stat should be the
right choice. /proc/{softirqs,interrupts} is just for immediate state.

>
> Anyway, it's incompatibility change.

Yup, I should have marked the patch with RFC :)

Thanks,
Yong

> I don't think this is valuable change.
>
>
>> ---
>> Âfs/proc/softirqs.c | Â Â4 ++--
>> Â1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c
>> index 62604be..2b32b46 100644
>> --- a/fs/proc/softirqs.c
>> +++ b/fs/proc/softirqs.c
>> @@ -11,13 +11,13 @@ static int show_softirqs(struct seq_file *p, void *v)
>> Â Â Â int i, j;
>>
>> Â Â Â seq_puts(p, " Â Â Â Â Â Â Â Â Â Â");
>> - Â Â for_each_possible_cpu(i)
>> + Â Â for_each_online_cpu(i)
>> Â Â Â Â Â Â Â seq_printf(p, "CPU%-8d", i);
>> Â Â Â seq_putc(p, '\n');
>>
>> Â Â Â for (i = 0; i < NR_SOFTIRQS; i++) {
>> Â Â Â Â Â Â Â seq_printf(p, "%12s:", softirq_to_name[i]);
>> - Â Â Â Â Â Â for_each_possible_cpu(j)
>> + Â Â Â Â Â Â for_each_online_cpu(j)
>> Â Â Â Â Â Â Â Â Â Â Â seq_printf(p, " %10u", kstat_softirqs_cpu(i, j));
>> Â Â Â Â Â Â Â seq_putc(p, '\n');
>> Â Â Â }
>
>
>



--
Only stand for myself
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/