lkml.org 
[lkml]   [2011]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc/softirqs: only show state for online cpus
>> Offtopic, /proc/interrupt should be protected by get_online_cpus().
>> Otherwise the header (i.e. cpu number) and the actual statistics fields
>> can be mismatched likes following. Am I missing something?
>
> I think you are right. The reader could be preempted by cpu hotplug.
>
> After searching the whole tree, only s390 take cpu_hotplug.lock,
> but its usage is not currect:
>
> arch/s390/kernel/irq.c:
> int show_interrupts(struct seq_file *p, void *v)
> {
> get_online_cpus();
> .........
> put_online_cpus();
> }
>
> Because the reader will call show_interrupts nr_irqs times.
> So get_online_cpus()/put_online_cpus() should be put upper,
> maybe interrupts_open(). How do you think about it?

I agree with you.




\
 
 \ /
  Last update: 2011-07-26 09:55    [W:0.060 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site