Re: [PATCH v3 4/4] /proc/stat: Call kstat_irqs_usr() only for active IRQs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Waiman,

On Mon, 14 Jan 2019, Waiman Long wrote:
> On 01/11/2019 04:02 PM, Thomas Gleixner wrote:
> > @@ -919,11 +920,15 @@ unsigned int kstat_irqs_cpu(unsigned int
> >  unsigned int kstat_irqs(unsigned int irq)
> >  {
> >  	struct irq_desc *desc = irq_to_desc(irq);
> > -	int cpu;
> >  	unsigned int sum = 0;
> > +	int cpu;
> >  
> >  	if (!desc || !desc->kstat_irqs)
> >  		return 0;
> > +	if (!irq_settings_is_per_cpu_devid(desc) &&
> > +	    !irq_settings_is_per_cpu(desc))
> > +	    return desc->tot_count;
> > +
> >  	for_each_possible_cpu(cpu)
> >  		sum += *per_cpu_ptr(desc->kstat_irqs, cpu);
> >  	return sum;
> >
> >
> That looks good to me. Thanks for providing a more simple solution.
> 
> BTW, if the percpu IRQ is known at allocation time, maybe we should just
> not allocate a percpu count for the corresponding descriptor.

Nope. You still need the per cpu accounting for /proc/interrupts ...

Thanks,

	tglx



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux