netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 5/5] qdisc: avoid transmit softirq on watchdog wakeup
Date: Wed, 21 Mar 2007 10:42:36 -0700	[thread overview]
Message-ID: <20070321174422.812295327@linux-foundation.org> (raw)
In-Reply-To: 20070321174231.890361963@linux-foundation.org

[-- Attachment #1: qdisc-avoid-softirq.patch --]
[-- Type: text/plain, Size: 886 bytes --]

If possible, avoid having to do a transmit softirq when a qdisc
watchdog decides to re-enable.  The watchdog routine runs off
a timer, so it is already in the same effective context as
the softirq.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 net/sched/sch_api.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- net-2.6.22.orig/net/sched/sch_api.c
+++ net-2.6.22/net/sched/sch_api.c
@@ -296,10 +296,16 @@ static enum hrtimer_restart qdisc_watchd
 {
 	struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog,
 						 timer);
+	struct net_device *dev = wd->qdisc->dev;
 
 	wd->qdisc->flags &= ~TCQ_F_THROTTLED;
 	smp_wmb();
-	netif_schedule(wd->qdisc->dev);
+	if (spin_trylock(&dev->queue_lock)) {
+		qdisc_run(dev);
+		spin_unlock(&dev->queue_lock);
+	} else
+		netif_schedule(dev);
+
 	return HRTIMER_NORESTART;
 }
 

-- 


  parent reply	other threads:[~2007-03-21 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-21 17:42 [PATCH 0/5] netem performance improvements Stephen Hemminger
2007-03-21 17:42 ` [PATCH 1/5] netem: report reorder percent correctly Stephen Hemminger
2007-03-21 17:42 ` [PATCH 2/5] netem: use better types for time values Stephen Hemminger
2007-03-21 17:42 ` [PATCH 3/5] netem: optimize tfifo Stephen Hemminger
2007-03-21 17:42 ` [PATCH 4/5] netem: avoid excessive requeues Stephen Hemminger
2007-03-22 20:40   ` Patrick McHardy
2007-03-22 21:08     ` David Miller
2007-03-23 11:06       ` Patrick McHardy
2007-03-23 13:26         ` Patrick McHardy
2007-03-21 17:42 ` Stephen Hemminger [this message]
2007-03-22 19:19 ` [PATCH 0/5] netem performance improvements David Miller

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=20070321174422.812295327@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=davem@davemloft.net \
    --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).