diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-08-21 05:11:14 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-21 05:11:14 -0700 |
commit | 2540e0511ea17e25831be543cdf9381e6209950d (patch) | |
tree | 31c505b9957d82125cd7e779d83da0d389f9d336 /include | |
parent | 5e739d1752aca4e8f3e794d431503bfca3162df4 (diff) | |
download | talos-op-linux-2540e0511ea17e25831be543cdf9381e6209950d.tar.gz talos-op-linux-2540e0511ea17e25831be543cdf9381e6209950d.zip |
pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() race
dev_deactivate() can skip rescheduling of a qdisc by qdisc_watchdog()
or other timer calling netif_schedule() after dev_queue_deactivate().
We prevent this checking aliveness before scheduling the timer. Since
during deactivation the root qdisc is available only as qdisc_sleeping
additional accessor qdisc_root_sleeping() is created.
With feedback from Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sch_generic.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 84d25f2e6188..b1d2cfea89c5 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -193,6 +193,11 @@ static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) return qdisc->dev_queue->qdisc; } +static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) +{ + return qdisc->dev_queue->qdisc_sleeping; +} + /* The qdisc root lock is a mechanism by which to top level * of a qdisc tree can be locked from any qdisc node in the * forest. This allows changing the configuration of some |