lkml.org 
[lkml]   [2019]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/4] /proc/stat: Call kstat_irqs_usr() only for active IRQs
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

\
 
 \ /
  Last update: 2019-01-15 10:26    [W:0.057 / U:28.424 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site