[Top] [All Lists]

[RFC/PATCH] lockless loopback patch for 2.6 (version 2)

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [RFC/PATCH] lockless loopback patch for 2.6 (version 2)
From: Arthur Kepner <akepner@xxxxxxx>
Date: Mon, 14 Jun 2004 10:03:52 -0700
Cc: netdev@xxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx

About three weeks ago I sent a patch to address lock contention on
the loopback device. I received several constructive criticisms and
now have a second version which is attached. The patch is against

Why this is useful

Lock contention on the loopback can be a serious performance problem
on large (>32 cpu) multiprocessor systems, even leading to near-livelock.

There is supporting lockstat data in the email which accompanied my first

Issues addressed in the second version of the patch

Here's a summary of the comments on the first patch and the actions that
were taken (let me know if I missed anything):

1) It prevented the use of queueing disciplines on the loopback.

Ugh, that it did.

The new patch makes struct Qdisc an "rcu structure". It isn't deleted
until it's known that no references to it exist (or at least none should
exist.) This allows lockless read access (to a possibly stale Qdisc.)
This gives the performance benefits of the previous patch, and doesn't
prevent the use of queueing disciplines on the loopback.

(I'd especially appreciate comments on the interaction with Qdiscs.)

2) Should use per-cpu stats rather than slots in an array.


3) It's ugly

It's now beautiful ;-)

There was also the suggestion of creating multiple loopback devices, but
I preferred not to do that.



Attachment: lockless_loopback.patch.2
Description: lockless_loopback.patch.2

<Prev in Thread] Current Thread [Next in Thread>