mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Matthew Wilcox <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Davidlohr Bueso <dave@stgolabs.net>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Daniel Colascione <dancol@google.com>,
	Dave Chinner <david@fromorbit.com>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v3 4/4] /proc/stat: Call kstat_irqs_usr() only for active IRQs
Date: Tue, 15 Jan 2019 10:52:27 -0500	[thread overview]
Message-ID: <86453b9a-f7c3-73a5-c5a1-bfff3cb4bade@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1901151023550.1865@nanos.tec.linutronix.de>

On 01/15/2019 04:24 AM, Thomas Gleixner wrote:
> 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 ..

Yes, you are right.

Thanks,
Longman

      reply	other threads:[~2019-01-15 15:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 19:20 [PATCH v3 0/4] /proc/stat: Reduce irqs counting performance overhead Waiman Long
2019-01-09 19:20 ` [PATCH v3 1/4] /proc/stat: Extract irqs counting code into show_stat_irqs() Waiman Long
2019-01-09 19:20 ` [PATCH v3 2/4] /proc/stat: Only do percpu sum of active IRQs Waiman Long
2019-01-09 19:20 ` [PATCH v3 3/4] genirq: Track the number " Waiman Long
2019-01-09 19:20 ` [PATCH v3 4/4] /proc/stat: Call kstat_irqs_usr() only for " Waiman Long
2019-01-11 17:23   ` Thomas Gleixner
2019-01-11 19:19     ` Thomas Gleixner
2019-01-11 19:23       ` Matthew Wilcox
2019-01-11 21:02         ` Thomas Gleixner
2019-01-14 19:04           ` Waiman Long
2019-01-15  9:24             ` Thomas Gleixner
2019-01-15 15:52               ` Waiman Long [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86453b9a-f7c3-73a5-c5a1-bfff3cb4bade@redhat.com \
    --to=longman@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dancol@google.com \
    --cc=dave@stgolabs.net \
    --cc=david@fromorbit.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®