pkt_sched: Perform bulk of qdisc destruction in RCU.
authorDavid S. Miller <davem@davemloft.net>
Thu, 17 Jul 2008 07:47:45 +0000 (00:47 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jul 2008 02:21:22 +0000 (19:21 -0700)
commit8a34c5dc3a7c6431f1cd94c0904be81b296e08ca
treefd4f5f3872ab0470622d49d02c58334f5c24adec
parent16361127ebed0fb8f9d7cc94c6e137eaf710f676
pkt_sched: Perform bulk of qdisc destruction in RCU.

This allows less strict control of access to the qdisc attached to a
netdev_queue.  It is even allowed to enqueue into a qdisc which is
in the process of being destroyed.  The RCU handler will toss out
those packets.

We will need this to handle sharing of a qdisc amongst multiple
TX queues.  In such a setup the lock has to be shared, so will
be inside of the qdisc itself.  At which point the netdev_queue
lock cannot be used to hard synchronize access to the ->qdisc
pointer.

One operation we have to keep inside of qdisc_destroy() is the list
deletion.  It is the only piece of state visible after the RCU quiesce
period, so we have to undo it early and under the appropriate locking.

The operations in the RCU handler do not need any looking because the
qdisc tree is no longer visible to anything at that point.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c