Thread (34 messages) 34 messages, 4 authors, 2011-03-04

Re: [PATCH] sched: QFQ - quick fair queue scheduler (v2)

flat view

From: Eric Dumazet <hidden>
Date: 2011-03-02 15:53:37

Le lundi 28 février 2011 à 17:17 -0800, Stephen Hemminger a écrit :
This is an implementation of the Quick Fair Queue scheduler developed
by Fabio Checconi. The same algorithm is already implemented in ipfw
in FreeBSD. Fabio had an earlier version developed on Linux, I just
cleaned it up and tested it. All bugs are mine.


Here is my crash analysis :
quoted hunk ↗ jump to hunk
+static void qfq_reset_qdisc(struct Qdisc *sch)
+{
+	struct qfq_sched *q = qdisc_priv(sch);
+	struct qfq_group *grp;
+	struct qfq_class *cl, **pp;
+	struct hlist_node *n;
+	unsigned int i, j;
+
+	for (i = 0; i <= QFQ_MAX_INDEX; i++) {
+		grp = &q->groups[i];
+		for (j = 0; j < QFQ_MAX_SLOTS; j++) {
+			for (pp = &grp->slots[j]; *pp; pp = &(*pp)->next) {
+				cl = *pp;
+				if (cl->qdisc->q.qlen)
+					qfq_deactivate_class(q, cl, pp);
Here, if we deactivated last class in chain, *pp is NULL, but

pp = &(*pp)->next  put 0x50 (on 64bit arches) in pp, so we crash ...




quoted hunk ↗ jump to hunk
+			}
+		}
+	}
+
+	for (i = 0; i < q->clhash.hashsize; i++) {
+		hlist_for_each_entry(cl, n, &q->clhash.hash[i], common.hnode)
+			qdisc_reset(cl->qdisc);
+	}
+	sch->q.qlen = 0;
+}
+

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help