From: jamal <hadi@cyberus.ca>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Robert Olsson <Robert.Olsson@data.slu.se>
Subject: Re: [NET]: Prevent multiple qdisc runs
Date: Thu, 22 Jun 2006 15:31:22 -0400 [thread overview]
Message-ID: <1151004682.5392.97.camel@jzny2> (raw)
In-Reply-To: <20060620235207.GA31493@gondor.apana.org.au>
On Wed, 2006-21-06 at 09:52 +1000, Herbert Xu wrote:
> Well my gut feeling is that multiple qdisc_run's on the same dev can't
> be good for perfomance. The reason is that SMP is only good when the
> CPUs work on different tasks. If you get two or more CPUs to work on
> qdisc_run at the same time they can still only supply one skb to the
> device at any time. What's worse is that they will now have to fight
> over the two spin locks involved which means that their cache lines
> will bounce back and forth.
1) If the CPUs collide all the time it is without a doubt
it is a bad thing (you can tell from tx_collission stats).
2) If on the other hand, the iota that a CPU enters that path in the
softirq it gets the txlock then there is benefit to not serialize
at the level you have done with that patch - you are enlarging the
granularity of the serialization so much so that the CPU wont even
get the opportunity to try and grab tx lock because it finds qdisc is
already running.
Your gut feeling is for #1 and my worry is for #2 ;->
I actually think your change is obviously valuable for scenarios where
the bus is slower and therefore transmits take longer - my feeling is it
may not be beneficial for fast buses like PCI-E or high speed PCI/X
where the possibility of getting access tx collision is lower.
The other reason I mentioned earlier as justification to leave the
granularity at the level where it was is for good qos clocking. i.e
to allow incoming packets to be used to clock the tx path - otherwise
you will be dependent on HZ for your egress rate accuracy. I am not sure
if this later point made sense - I could elaborate.
The experiment needed to prove things is not hard: one needs to get a 2
or 4way machine and create a "funneling" effect to one NIC.
For forwarding, the best setup will be to have 3 NICs. packets coming in
on 2 NICs are forwarded to a third. The incoming-packet NICS are tied to
different CPUs. In a 4way, the outgoing as well is tied to its own CPU.
You then pummel the two incoming CPUs with pktgen or otherwise
at something like 1Mpps (which is higher than the wire rate the third
nic can handle).
cheers,
jamal
next prev parent reply other threads:[~2006-06-22 19:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-19 12:15 [NET]: Prevent multiple qdisc runs Herbert Xu
2006-06-19 13:33 ` jamal
2006-06-19 13:42 ` Herbert Xu
2006-06-19 14:23 ` jamal
2006-06-19 14:29 ` Herbert Xu
2006-06-19 14:36 ` jamal
2006-06-19 22:33 ` Herbert Xu
2006-06-20 14:42 ` jamal
2006-06-20 23:52 ` Herbert Xu
2006-06-22 19:31 ` jamal [this message]
2006-06-22 22:43 ` Herbert Xu
2006-06-23 0:52 ` jamal
2006-06-23 3:35 ` Herbert Xu
2006-06-24 13:50 ` Jamal Hadi Salim
2006-06-20 6:57 ` David Miller
2006-06-20 7:00 ` Herbert Xu
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=1151004682.5392.97.camel@jzny2 \
--to=hadi@cyberus.ca \
--cc=Robert.Olsson@data.slu.se \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@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).