[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1901151023550.1865@nanos.tec.linutronix.de>
Date: Tue, 15 Jan 2019 10:24:59 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Waiman Long <longman@...hat.com>
cc: Matthew Wilcox <willy@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Kees Cook <keescook@...omium.org>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Davidlohr Bueso <dave@...olabs.net>,
Miklos Szeredi <miklos@...redi.hu>,
Daniel Colascione <dancol@...gle.com>,
Dave Chinner <david@...morbit.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [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
Powered by blists - more mailing lists