From: Keith Owens <kaos@ocs.com.au>
To: Martin Peschke <mp3@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, ak@suse.de,
hch@infradead.org, arjan@infradead.org, James.Smart@Emulex.Com,
James.Bottomley@SteelEye.com
Subject: Re: [RFC] [Patch 5/8] statistics infrastructure
Date: Wed, 17 May 2006 14:29:07 +1000 [thread overview]
Message-ID: <17193.1147840147@ocs3> (raw)
In-Reply-To: Your message of "Tue, 16 May 2006 19:46:38 +0200." <446A0FFE.70707@de.ibm.com>
Martin Peschke (on Tue, 16 May 2006 19:46:38 +0200) wrote:
>+static inline void statistic_add(struct statistic *stat, int i,
>+ s64 value, u64 incr)
>+{
>+ int cpu;
>+ unsigned long flags;
>+
>+ if (stat[i].state == statistic_state_on) {
>+ cpu = get_cpu();
>+ local_irq_save(flags);
>+ stat[i].add(&stat[i], cpu, value, incr);
>+ local_irq_restore(flags);
>+ put_cpu();
>+ }
>+}
Using get_cpu()/put_cpu() is pure overhead when you are disabling
interrupts as well.
if (stat[i].state == statistic_state_on) {
local_irq_save(flags);
stat[i].add(&stat[i], smp_processor_id(), value, incr);
local_irq_restore(flags);
}
next prev parent reply other threads:[~2006-05-17 4:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-16 17:46 [RFC] [Patch 5/8] statistics infrastructure Martin Peschke
2006-05-16 20:13 ` Chase Venters
2006-05-17 4:29 ` Keith Owens [this message]
2006-05-17 15:53 ` Martin Peschke
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=17193.1147840147@ocs3 \
--to=kaos@ocs.com.au \
--cc=James.Bottomley@SteelEye.com \
--cc=James.Smart@Emulex.Com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mp3@de.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.