Skip to content

Commit 2af8cfa

Browse files
committed
Merge branch 'fq_codel-small-optimizations'
Dave Taht says: ==================== Two small fq_codel optimizations These two patches improve fq_codel performance under extreme network loads. The first patch more rapidly escalates the codel count under overload, the second just kills a totally useless statistic. (sent together because they'd otherwise conflict) ==================== Signed-off-by: Dave Taht <dave.taht@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents b8fb640 + 77ddaff commit 2af8cfa

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

net/sched/sch_fq_codel.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ struct fq_codel_flow {
4545
struct sk_buff *tail;
4646
struct list_head flowchain;
4747
int deficit;
48-
u32 dropped; /* number of drops (or ECN marks) on this flow */
4948
struct codel_vars cvars;
5049
}; /* please try to keep this structure <= 64 bytes */
5150

@@ -173,7 +172,8 @@ static unsigned int fq_codel_drop(struct Qdisc *sch, unsigned int max_packets,
173172
__qdisc_drop(skb, to_free);
174173
} while (++i < max_packets && len < threshold);
175174

176-
flow->dropped += i;
175+
/* Tell codel to increase its signal strength also */
176+
flow->cvars.count += i;
177177
q->backlogs[idx] -= len;
178178
q->memory_usage -= mem;
179179
sch->qstats.drops += i;
@@ -211,7 +211,6 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch,
211211
list_add_tail(&flow->flowchain, &q->new_flows);
212212
q->new_flow_count++;
213213
flow->deficit = q->quantum;
214-
flow->dropped = 0;
215214
}
216215
get_codel_cb(skb)->mem_usage = skb->truesize;
217216
q->memory_usage += get_codel_cb(skb)->mem_usage;
@@ -310,9 +309,6 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
310309
&flow->cvars, &q->cstats, qdisc_pkt_len,
311310
codel_get_enqueue_time, drop_func, dequeue_func);
312311

313-
flow->dropped += q->cstats.drop_count - prev_drop_count;
314-
flow->dropped += q->cstats.ecn_mark - prev_ecn_mark;
315-
316312
if (!skb) {
317313
/* force a pass through old_flows to prevent starvation */
318314
if ((head == &q->new_flows) && !list_empty(&q->old_flows))
@@ -658,7 +654,7 @@ static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl,
658654
sch_tree_unlock(sch);
659655
}
660656
qs.backlog = q->backlogs[idx];
661-
qs.drops = flow->dropped;
657+
qs.drops = 0;
662658
}
663659
if (gnet_stats_copy_queue(d, NULL, &qs, qs.qlen) < 0)
664660
return -1;

0 commit comments

Comments
 (0)