Skip to contentSkip to conversation

assertion failure at net/sched/sch_generic.c(530)

DISCUSSION David Brownell 2 participants 6 messages Sep 24, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

After running some TTCP tests (unidirectional TTCP 9+ hours, then bidirectional for about 8 hours more) over a network link, I shut it down the usual way and got an unusual message. I've never seen this before; this is a recent 2.6.0-test5 BK snapshot (a few days old):

KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530)

Could someone please translate that for me -- trouble?

The interface was down at that point, and this was evidently triggered by the unregister_netdev() that "rmmod" caused.

- Dave

#1 lore raw
Quoted 2 lines · On Tue, 23 Sep 2003 17:11:22 -0700 David Brownell <[email protected]> wrote:

KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530)

Crap, I think I know what made this start happening.

Jamal, your pfifo_fast statistics patch added this to dev_activate() when we decide to add a default discipline:

                        write_lock(&qdisc_tree_lock);
                        qdisc->next = dev->qdisc_list;
                        dev->qdisc_list = qdisc;
                        write_unlock(&qdisc_tree_lock);

Something probably isn't clearing it later on when we down the device.

Doesn't the ->reset() operation need to do this list removal? If so, that's the problem, pfifo_fast_reset() isn't doing the dev->qdisc_list removal. Actually it seems like qdisc_destroy() takes care of it.

Or another possibility is that pfifo_fast is being added twice to the list.

#2 lore raw
Quoted 7 lines · On Tue, 23 Sep 2003 17:02:16 -0700 "David S. Miller" <[email protected]> wrote:
Quoted 2 lines · On Tue, 23 Sep 2003 17:11:22 -0700 David Brownell <[email protected]> wrote:

KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530)

Crap, I think I know what made this start happening.

Wait, David do you have CONFIG_NET_SCHED enabled in your config?

Qdiscs don't get unlinked in qdisc_destroy() unless that config is enabled. If you have it off, that explains the bug and the fix is obvious.

#3 lore raw
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530)

Crap, I think I know what made this start happening.

Wait, David do you have CONFIG_NET_SCHED enabled in your config?

No ...

Quoted 3 lines

Qdiscs don't get unlinked in qdisc_destroy() unless that config is enabled. If you have it off, that explains the bug and the fix is obvious.

Well, obvious to people who know that part of the stack ... :)

#4 lore raw
Quoted 5 lines · On Tue, 23 Sep 2003 17:44:30 -0700 David Brownell <[email protected]> wrote:
Quoted 3 lines

Qdiscs don't get unlinked in qdisc_destroy() unless that config is enabled. If you have it off, that explains the bug and the fix is obvious.

Well, obvious to people who know that part of the stack ... :)

Honest, it's a pretty simple bug :) Try this patch:

sched/sch_generic.c renamed from sched/sch_generic.c.~1~ +0 -2
@@ -416,7 +416,6 @@
 
 	dev = qdisc->dev;
 
-#ifdef CONFIG_NET_SCHED
 	if (dev) {
 		struct Qdisc *q, **qp;
 		for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) {
@@ -428,7 +427,6 @@
 	}
 #ifdef CONFIG_NET_ESTIMATOR
 	qdisc_kill_estimator(&qdisc->stats);
-#endif
 #endif
 	if (ops->reset)
 		ops->reset(qdisc);
#5 lore raw
Quoted 1 line · David S. Miller

Honest, it's a pretty simple bug :) Try this patch:

Yes, I see. The patch resolved this problem.

- Dave

Quoted 20 lines
sched/sch_generic.c renamed from sched/sch_generic.c.~1~ +0 -2
@@ -416,7 +416,6 @@
 
 	dev = qdisc->dev;
 
-#ifdef CONFIG_NET_SCHED
 	if (dev) {
 		struct Qdisc *q, **qp;
 		for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) {
@@ -428,7 +427,6 @@
 	}
 #ifdef CONFIG_NET_ESTIMATOR
 	qdisc_kill_estimator(&qdisc->stats);
-#endif
 #endif
 	if (ops->reset)
 		ops->reset(qdisc);