[PATCH alternative] pkt_sched: Move qdisc_put_stab() from BH context.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <netdev@...>
Date: Monday, August 11, 2008 - 6:25 pm

On Mon, Aug 11, 2008 at 11:42:39PM +0200, Jarek Poplawski wrote:

...Or instead of this:
-------------> (alternative version)

pkt_sched: Move qdisc_put_stab() from BH context.

Since qdisc_stab_lock is used in qdisc_put_stab(), which is called in
BH context from __qdisc_destroy() RCU callback, softirq safe locking
should be used. Alternatively we can move this to qdisc_destroy(). 


Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

---
(Apply on top of: pkt_sched: Destroy gen estimator under rtnl_lock().)

diff -Nurp a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c	2008-08-12 00:04:22.000000000 +0200
+++ b/net/sched/sch_generic.c	2008-08-12 00:08:24.000000000 +0200
@@ -525,9 +525,6 @@ static void __qdisc_destroy(struct rcu_h
 {
 	struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
 
-#ifdef CONFIG_NET_SCHED
-	qdisc_put_stab(qdisc->stab);
-#endif
 	dev_put(qdisc_dev(qdisc));
 
 	kfree_skb(qdisc->gso_skb);
@@ -548,6 +545,9 @@ void qdisc_destroy(struct Qdisc *qdisc)
 	if (qdisc->parent)
 		list_del(&qdisc->list);
 
+#ifdef CONFIG_NET_SCHED
+	qdisc_put_stab(qdisc->stab);
+#endif
 	gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
 	if (ops->reset)
 		ops->reset(qdisc);
--
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:
[PATCH] pkt_sched: Add BH protection for qdisc_stab_lock., Jarek Poplawski, (Mon Aug 11, 5:42 pm)
[PATCH alternative] pkt_sched: Move qdisc_put_stab() from BH..., Jarek Poplawski, (Mon Aug 11, 6:25 pm)