Skip to content

Commit 10239ed

Browse files
Terry Lamdavem330
Terry Lam
authored andcommitted
net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc
This patch implements the first size-based qdisc that attempts to differentiate between small flows and heavy-hitters. The goal is to catch the heavy-hitters and move them to a separate queue with less priority so that bulk traffic does not affect the latency of critical traffic. Currently "less priority" means less weight (2:1 in particular) in a Weighted Deficit Round Robin (WDRR) scheduler. In essence, this patch addresses the "delay-bloat" problem due to bloated buffers. In some systems, large queues may be necessary for obtaining CPU efficiency, or due to the presence of unresponsive traffic like UDP, or just a large number of connections with each having a small amount of outstanding traffic. In these circumstances, HHF aims to reduce the HoL blocking for latency sensitive traffic, while not impacting the queues built up by bulk traffic. HHF can also be used in conjunction with other AQM mechanisms such as CoDel. To capture heavy-hitters, we implement the "multi-stage filter" design in the following paper: C. Estan and G. Varghese, "New Directions in Traffic Measurement and Accounting", in ACM SIGCOMM, 2002. Some configurable qdisc settings through 'tc': - hhf_reset_timeout: period to reset counter values in the multi-stage filter (default 40ms) - hhf_admit_bytes: threshold to classify heavy-hitters (default 128KB) - hhf_evict_timeout: threshold to evict idle heavy-hitters (default 1s) - hhf_non_hh_weight: Weighted Deficit Round Robin (WDRR) weight for non-heavy-hitters (default 2) - hh_flows_limit: max number of heavy-hitter flow entries (default 2048) Note that the ratio between hhf_admit_bytes and hhf_reset_timeout reflects the bandwidth of heavy-hitters that we attempt to capture (25Mbps with the above default settings). The false negative rate (heavy-hitter flows getting away unclassified) is zero by the design of the multi-stage filter algorithm. With 100 heavy-hitter flows, using four hashes and 4000 counters yields a false positive rate (non-heavy-hitters mistakenly classified as heavy-hitters) of less than 1e-4. Signed-off-by: Terry Lam <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2a2529e commit 10239ed

File tree

4 files changed

+781
-0
lines changed

4 files changed

+781
-0
lines changed

include/uapi/linux/pkt_sched.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,4 +790,29 @@ struct tc_fq_qd_stats {
790790
__u32 throttled_flows;
791791
__u32 pad;
792792
};
793+
794+
/* Heavy-Hitter Filter */
795+
796+
enum {
797+
TCA_HHF_UNSPEC,
798+
TCA_HHF_BACKLOG_LIMIT,
799+
TCA_HHF_QUANTUM,
800+
TCA_HHF_HH_FLOWS_LIMIT,
801+
TCA_HHF_RESET_TIMEOUT,
802+
TCA_HHF_ADMIT_BYTES,
803+
TCA_HHF_EVICT_TIMEOUT,
804+
TCA_HHF_NON_HH_WEIGHT,
805+
__TCA_HHF_MAX
806+
};
807+
808+
#define TCA_HHF_MAX (__TCA_HHF_MAX - 1)
809+
810+
struct tc_hhf_xstats {
811+
__u32 drop_overlimit; /* number of times max qdisc packet limit
812+
* was hit
813+
*/
814+
__u32 hh_overlimit; /* number of times max heavy-hitters was hit */
815+
__u32 hh_tot_count; /* number of captured heavy-hitters so far */
816+
__u32 hh_cur_count; /* number of current heavy-hitters */
817+
};
793818
#endif

net/sched/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,15 @@ config NET_SCH_FQ
286286

287287
If unsure, say N.
288288

289+
config NET_SCH_HHF
290+
tristate "Heavy-Hitter Filter (HHF)"
291+
help
292+
Say Y here if you want to use the Heavy-Hitter Filter (HHF)
293+
packet scheduling algorithm.
294+
295+
To compile this driver as a module, choose M here: the module
296+
will be called sch_hhf.
297+
289298
config NET_SCH_INGRESS
290299
tristate "Ingress Qdisc"
291300
depends on NET_CLS_ACT

net/sched/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ obj-$(CONFIG_NET_SCH_QFQ) += sch_qfq.o
4040
obj-$(CONFIG_NET_SCH_CODEL) += sch_codel.o
4141
obj-$(CONFIG_NET_SCH_FQ_CODEL) += sch_fq_codel.o
4242
obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o
43+
obj-$(CONFIG_NET_SCH_HHF) += sch_hhf.o
4344

4445
obj-$(CONFIG_NET_CLS_U32) += cls_u32.o
4546
obj-$(CONFIG_NET_CLS_ROUTE4) += cls_route.o

0 commit comments

Comments
 (0)