From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
linux-arch@vger.kernel.org,
Christoph Lameter <cl@linux-foundation.org>,
netdev <netdev@vger.kernel.org>,
Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>
Subject: Re: Poll about irqsafe_cpu_add and others
Date: Fri, 18 Mar 2011 17:56:24 +1100 [thread overview]
Message-ID: <1300431384.22236.1280.camel@pasglop> (raw)
In-Reply-To: <1300371834.6315.93.camel@edumazet-laptop>
On Thu, 2011-03-17 at 15:23 +0100, Eric Dumazet wrote:
> Hi
>
> irqsafe_cpu_{dec|inc} are used in network stack since 2.6.37 (commit
> 29b4433d991c88), and I would like to use irqsafe_cpu_add() in netfilter
> fast path too, and SNMP counters eventually (to lower ram needs by 50%)
>
> Initial support of irqsafe_ was given by Christoph in 2.6.34
>
> It seems only x86 arch is using a native and efficient implementation.
>
> Others use irqsafe_cpu_generic_to_op() and its pair of
> local_irq_save() / local_irq_restore()
>
> Which other arches could use a native implementation ?
>
> What about defining a HAVE_FAST_IRQSAFE_ADD ?
On powerpc, we use the generic one and it's fast :-) Well, at least on
ppc64, bcs we do lazy irq disabling, disabling/enabling interrupt is
basically just poking a byte in a per-cpu data structure (there's a tad
more work on enable in case the interrupt actually occured and we ended
up really disabling but that's not the common case). Overall faster than
using the atomic ops which have to go all the way to the L2 cache.
So if you define the above, please set in on powerpc despite the fact
that we use the generic implementation.
Cheers,
Ben.
prev parent reply other threads:[~2011-03-18 6:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 14:23 Poll about irqsafe_cpu_add and others Eric Dumazet
2011-03-17 14:40 ` Christoph Lameter
2011-03-17 15:14 ` David Miller
2011-03-17 15:18 ` Christoph Lameter
2011-03-17 16:53 ` Eric Dumazet
2011-03-17 17:46 ` Christoph Lameter
2011-03-17 18:29 ` Eric Dumazet
2011-03-17 18:42 ` Christoph Lameter
2011-03-17 18:55 ` Eric Dumazet
2011-03-17 19:21 ` Christoph Lameter
2011-03-18 6:56 ` Benjamin Herrenschmidt [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=1300431384.22236.1280.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=cl@linux-foundation.org \
--cc=eric.dumazet@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).