Re: [PATCH take 2] pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() race
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2008-08-21 06:10:30
On Thu, Aug 21, 2008 at 05:49:11AM +0000, Jarek Poplawski wrote:
---------------> (take 2) 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 [off-list ref] Signed-off-by: Jarek Poplawski <redacted>
Good catch!
quoted hunk ↗ jump to hunk
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 84d25f2..b1d2cfe 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; +}
When would we actually want the non-sleeping variant? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt