Re: High contention on the sk_buff_head.lock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jarek Poplawski
Date: Friday, March 20, 2009 - 4:29 pm

Vernon Mauery wrote, On 03/18/2009 09:17 PM:
...

I think there would be interesting to check another idea around this
contention: not all contenders are equal here. One thread is doing
qdisc_run() and owning the transmit queue (even after releasing the TX
lock). So if it waits for the qdisc lock the NIC, if not multiqueue,
is idle. Probably some handicap like in the patch below could make
some difference in throughput; alas I didn't test it.

Jarek P.
---

 net/core/dev.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index f112970..d5ad808 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1852,7 +1852,11 @@ gso:
 	if (q->enqueue) {
 		spinlock_t *root_lock = qdisc_lock(q);
 
-		spin_lock(root_lock);
+		while (!spin_trylock(root_lock)) {
+			do {
+				cpu_relax();
+			} while (spin_is_locked(root_lock));
+		}
 
 		if (unlikely(test_bit(__QDISC_STATE_DEACTIVATED, &q->state))) {
 			kfree_skb(skb);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
High contention on the sk_buff_head.lock, Vernon Mauery, (Wed Mar 18, 10:24 am)
Re: High contention on the sk_buff_head.lock, Eric Dumazet, (Wed Mar 18, 12:07 pm)
Re: High contention on the sk_buff_head.lock, Vernon Mauery, (Wed Mar 18, 1:17 pm)
Re: High contention on the sk_buff_head.lock, Andi Kleen, (Wed Mar 18, 1:54 pm)
Re: High contention on the sk_buff_head.lock, David Miller, (Wed Mar 18, 2:03 pm)
Re: High contention on the sk_buff_head.lock, Vernon Mauery, (Wed Mar 18, 2:07 pm)
Re: High contention on the sk_buff_head.lock, Vernon Mauery, (Wed Mar 18, 2:10 pm)
Re: High contention on the sk_buff_head.lock, David Miller, (Wed Mar 18, 2:38 pm)
Re: High contention on the sk_buff_head.lock, Eilon Greenstein, (Wed Mar 18, 2:45 pm)
Re: High contention on the sk_buff_head.lock, Vernon Mauery, (Wed Mar 18, 2:49 pm)
Re: High contention on the sk_buff_head.lock, Vernon Mauery, (Wed Mar 18, 2:51 pm)
Re: High contention on the sk_buff_head.lock, Gregory Haskins, (Wed Mar 18, 2:54 pm)
Re: High contention on the sk_buff_head.lock, Andi Kleen, (Wed Mar 18, 2:59 pm)
Re: High contention on the sk_buff_head.lock, Rick Jones, (Wed Mar 18, 3:19 pm)
Re: High contention on the sk_buff_head.lock, David Miller, (Wed Mar 18, 6:02 pm)
Re: High contention on the sk_buff_head.lock, David Miller, (Wed Mar 18, 6:03 pm)
Re: High contention on the sk_buff_head.lock, Sven-Thorsten Dietrich, (Wed Mar 18, 6:13 pm)
Re: High contention on the sk_buff_head.lock, Gregory Haskins, (Wed Mar 18, 8:48 pm)
Re: High contention on the sk_buff_head.lock, David Miller, (Wed Mar 18, 10:38 pm)
Re: High contention on the sk_buff_head.lock, Evgeniy Polyakov, (Thu Mar 19, 12:15 am)
Re: High contention on the sk_buff_head.lock, Gregory Haskins, (Thu Mar 19, 5:42 am)
Re: High contention on the sk_buff_head.lock, Peter W. Morreale, (Thu Mar 19, 5:50 am)
Re: High contention on the sk_buff_head.lock, Peter W. Morreale, (Thu Mar 19, 5:59 am)
Re: High contention on the sk_buff_head.lock, Peter W. Morreale, (Thu Mar 19, 6:36 am)
Re: High contention on the sk_buff_head.lock, Andi Kleen, (Thu Mar 19, 6:46 am)
Re: High contention on the sk_buff_head.lock, David Miller, (Thu Mar 19, 1:52 pm)
Re: High contention on the sk_buff_head.lock, Jarek Poplawski, (Fri Mar 20, 4:29 pm)
Re: High contention on the sk_buff_head.lock, Eric Dumazet, (Mon Mar 23, 1:32 am)
Re: High contention on the sk_buff_head.lock, David Miller, (Mon Mar 23, 1:37 am)
Re: High contention on the sk_buff_head.lock, Jarek Poplawski, (Mon Mar 23, 1:50 am)
Re: High contention on the sk_buff_head.lock, Herbert Xu, (Thu Apr 2, 7:13 am)
Re: High contention on the sk_buff_head.lock, Herbert Xu, (Thu Apr 2, 7:15 am)