From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: johnpol@2ka.mipt.ru, jeff@garzik.org, Robert.Olsson@data.slu.se,
netdev@vger.kernel.org, rdreier@cisco.com,
peter.p.waskiewicz.jr@intel.com, hadi@cyberus.ca,
mcarlson@broadcom.com, gaagaan@gmail.com, jagana@us.ibm.com,
general@lists.openfabrics.org, mchan@broadcom.com, tgraf@suug.ch,
randy.dunlap@oracle.com, shemminger@linux-foundation.org,
kaber@trash.net, sri@us.ibm.com
Subject: [ofa-general] Re: [PATCH 2/3][NET_BATCH] net core use batching
Date: Mon, 08 Oct 2007 19:43:43 -0700 (PDT) [thread overview]
Message-ID: <20071008.194343.52093065.davem@davemloft.net> (raw)
In-Reply-To: <20071009020318.GA14708@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 9 Oct 2007 10:03:18 +0800
> On Tue, Oct 09, 2007 at 10:01:15AM +0800, Herbert Xu wrote:
> > On Mon, Oct 08, 2007 at 06:41:26PM -0700, David Miller wrote:
> > >
> > > I also want to point out another issue. Any argument wrt. reordering
> > > is specious at best because right now reordering from qdisc to device
> > > happens anyways.
> >
> > This is not true.
> >
> > If your device has a qdisc at all, then you will end up in the
> > function qdisc_restart, where we release the queue lock only
> > after acquiring the TX lock.
> >
> > So right now this path does not create any reordering.
>
> Argh! Someone's just broken this. I think we should restore
> the original behaviour.
Right, that's Jamal's recent patch. It looked funny to me too.
I think we can't make this change, the acquisition of the device
transmit lock before we release the qdisc is the only thing that
prevents reordering between qdisc and device.
Otherwise all of the prioritization is pretty much for nothing as
I described in another email today.
Jamal, I'm pretty sure we have to revert this, you can't change the
locking in this way.
commit 41843197b17bdfb1f97af0a87c06d24c1620ba90
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date: Tue Sep 25 19:27:13 2007 -0700
[NET_SCHED]: explict hold dev tx lock
For N cpus, with full throttle traffic on all N CPUs, funneling traffic
to the same ethernet device, the devices queue lock is contended by all
N CPUs constantly. The TX lock is only contended by a max of 2 CPUS.
In the current mode of operation, after all the work of entering the
dequeue region, we may endup aborting the path if we are unable to get
the tx lock and go back to contend for the queue lock. As N goes up,
this gets worse.
The changes in this patch result in a small increase in performance
with a 4CPU (2xdual-core) with no irq binding. Both e1000 and tg3
showed similar behavior;
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index e970e8e..95ae119 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -134,34 +134,19 @@ static inline int qdisc_restart(struct net_device *dev)
{
struct Qdisc *q = dev->qdisc;
struct sk_buff *skb;
- unsigned lockless;
int ret;
/* Dequeue packet */
if (unlikely((skb = dev_dequeue_skb(dev, q)) == NULL))
return 0;
- /*
- * When the driver has LLTX set, it does its own locking in
- * start_xmit. These checks are worth it because even uncongested
- * locks can be quite expensive. The driver can do a trylock, as
- * is being done here; in case of lock contention it should return
- * NETDEV_TX_LOCKED and the packet will be requeued.
- */
- lockless = (dev->features & NETIF_F_LLTX);
-
- if (!lockless && !netif_tx_trylock(dev)) {
- /* Another CPU grabbed the driver tx lock */
- return handle_dev_cpu_collision(skb, dev, q);
- }
/* And release queue */
spin_unlock(&dev->queue_lock);
+ HARD_TX_LOCK(dev, smp_processor_id());
ret = dev_hard_start_xmit(skb, dev);
-
- if (!lockless)
- netif_tx_unlock(dev);
+ HARD_TX_UNLOCK(dev);
spin_lock(&dev->queue_lock);
q = dev->qdisc;
next prev parent reply other threads:[~2007-10-09 2:43 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 18:26 [PATCH 2/3][NET_BATCH] net core use batching jamal
2007-10-08 19:46 ` Waskiewicz Jr, Peter P
2007-10-08 20:48 ` jamal
2007-10-08 21:26 ` [ofa-general] " David Miller
2007-10-08 22:34 ` jamal
2007-10-08 22:36 ` [ofa-general] " Waskiewicz Jr, Peter P
2007-10-08 22:33 ` Waskiewicz Jr, Peter P
2007-10-08 23:40 ` jamal
2007-10-09 1:13 ` Jeff Garzik
2007-10-09 1:41 ` [ofa-general] " David Miller
2007-10-09 2:01 ` Herbert Xu
2007-10-09 2:03 ` Herbert Xu
2007-10-09 2:04 ` Herbert Xu
2007-10-09 2:15 ` jamal
2007-10-09 2:16 ` Herbert Xu
2007-10-09 2:19 ` [ofa-general] " jamal
2007-10-09 2:20 ` Herbert Xu
2007-10-09 2:45 ` [ofa-general] " David Miller
2007-10-09 2:43 ` David Miller [this message]
2007-10-09 2:46 ` Herbert Xu
2007-10-09 2:12 ` [ofa-general] " Jeff Garzik
2007-10-09 2:46 ` David Miller
2007-10-09 18:48 ` [ofa-general] " Waskiewicz Jr, Peter P
2007-10-09 19:04 ` Jeff Garzik
2007-10-09 19:07 ` Waskiewicz Jr, Peter P
2007-10-09 2:14 ` [ofa-general] " jamal
2007-10-09 2:16 ` Herbert Xu
2007-10-09 2:47 ` [ofa-general] " David Miller
2007-10-09 16:51 ` Andi Kleen
2007-10-09 18:22 ` Stephen Hemminger
2007-10-09 18:30 ` Andi Kleen
2007-10-09 20:43 ` David Miller
2007-10-09 20:53 ` Stephen Hemminger
2007-10-09 21:22 ` David Miller
2007-10-09 21:56 ` jamal
2007-10-10 0:04 ` David Miller
2007-10-10 0:37 ` Andi Kleen
2007-10-10 0:50 ` David Miller
2007-10-10 9:16 ` Andi Kleen
2007-10-10 9:25 ` David Miller
2007-10-10 10:23 ` Andi Kleen
2007-10-10 10:44 ` David Miller
2007-10-10 13:08 ` jamal
2007-10-10 22:37 ` David Miller
2007-10-10 15:35 ` Waskiewicz Jr, Peter P
2007-10-10 16:02 ` Andi Kleen
2007-10-10 16:42 ` Waskiewicz Jr, Peter P
2007-10-10 9:53 ` Herbert Xu
2007-10-12 16:08 ` Brandeburg, Jesse
2007-10-12 17:05 ` Stephen Hemminger
2007-10-12 18:29 ` Andi Kleen
2007-10-12 18:27 ` Andi Kleen
2007-10-10 16:02 ` Bill Fink
2007-10-10 22:53 ` David Miller
2007-10-11 6:52 ` Krishna Kumar2
2007-10-09 1:31 ` Jeff Garzik
2007-10-09 10:58 ` [ofa-general] " Krishna Kumar2
2007-10-09 11:02 ` David Miller
2007-10-09 11:20 ` [ofa-general] " Krishna Kumar2
2007-10-09 11:21 ` Krishna Kumar2
2007-10-09 11:24 ` David Miller
2007-10-09 12:44 ` [ofa-general] " Jeff Garzik
2007-10-09 12:55 ` Herbert Xu
2007-10-09 13:00 ` Jeff Garzik
2007-10-09 20:14 ` David Miller
2007-10-09 20:20 ` [ofa-general] " Jeff Garzik
2007-10-09 21:25 ` David Miller
2007-10-09 20:22 ` [ofa-general] " Roland Dreier
2007-10-09 20:51 ` David Miller
2007-10-09 21:40 ` Roland Dreier
2007-10-09 22:44 ` [ofa-general] " Roland Dreier
2007-10-09 22:46 ` [ofa-general] [PATCH 1/4] IPoIB: Fix unused variable warning Roland Dreier
2007-10-09 22:47 ` [ofa-general] [PATCH 2/4] ibm_emac: Convert to use napi_struct independent of struct net_device Roland Dreier
2007-10-09 22:47 ` [PATCH 3/4] ibm_new_emac: Nuke SET_MODULE_OWNER() use Roland Dreier
2007-10-09 22:48 ` [PATCH 4/4] ibm_emac: Convert to use napi_struct independent of struct net_device Roland Dreier
2007-10-09 22:51 ` [ofa-general] " Roland Dreier
2007-10-09 23:17 ` [PATCH 1/4] IPoIB: Fix unused variable warning David Miller
2007-10-10 0:32 ` Jeff Garzik
2007-10-10 0:47 ` [ofa-general] " Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-10-08 13:17 [PATCH 2/3][NET_BATCH] net core use batching jamal
2007-10-09 3:09 ` [ofa-general] " Krishna Kumar2
2007-10-09 13:10 ` jamal
2007-09-14 9:00 [PATCH 0/10 REV5] Implement skb batching and support in IPoIB/E1000 Krishna Kumar
2007-09-16 23:17 ` [ofa-general] " David Miller
2007-09-17 0:29 ` jamal
2007-09-23 17:53 ` [PATCHES] TX batching jamal
2007-09-23 17:56 ` [ofa-general] [PATCH 1/4] [NET_SCHED] explict hold dev tx lock jamal
2007-09-23 17:58 ` [ofa-general] [PATCH 2/4] [NET_BATCH] Introduce batching interface jamal
2007-09-23 18:00 ` [PATCH 3/4][NET_BATCH] net core use batching jamal
2007-09-30 18:52 ` [ofa-general] [PATCH 2/3][NET_BATCH] " jamal
2007-10-01 4:11 ` Bill Fink
2007-10-01 13:30 ` jamal
2007-10-02 4:25 ` [ofa-general] " Bill Fink
2007-10-02 13:20 ` jamal
2007-10-03 5:29 ` [ofa-general] " Bill Fink
2007-10-01 10:42 ` Patrick McHardy
2007-10-01 13:21 ` jamal
2007-10-08 5:03 ` Krishna Kumar2
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=20071008.194343.52093065.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Robert.Olsson@data.slu.se \
--cc=gaagaan@gmail.com \
--cc=general@lists.openfabrics.org \
--cc=hadi@cyberus.ca \
--cc=herbert@gondor.apana.org.au \
--cc=jagana@us.ibm.com \
--cc=jeff@garzik.org \
--cc=johnpol@2ka.mipt.ru \
--cc=kaber@trash.net \
--cc=mcarlson@broadcom.com \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=randy.dunlap@oracle.com \
--cc=rdreier@cisco.com \
--cc=shemminger@linux-foundation.org \
--cc=sri@us.ibm.com \
--cc=tgraf@suug.ch \
/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).