diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-06-26 11:47:12 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-06-27 09:25:08 +0200 |
commit | 08e1812900b4f2ab0d7a33b0e72be2d377a5b3d9 (patch) | |
tree | 1bf5f7cc4747d3c69c88d75ba357ed28807b019d /package | |
parent | aab535d2bbc414aecde5770152e7da6690462b9a (diff) | |
download | upstream-08e1812900b4f2ab0d7a33b0e72be2d377a5b3d9.tar.gz upstream-08e1812900b4f2ab0d7a33b0e72be2d377a5b3d9.tar.bz2 upstream-08e1812900b4f2ab0d7a33b0e72be2d377a5b3d9.zip |
mac80211: increase airtime scheduler quantum
improves performance by requiring fewer iterations over tx queues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 7bf5233a2a2b1c81fae2f3a85bb971ef2a7f9b27)
Diffstat (limited to 'package')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/337-mac80211-increase-quantum-for-airtime-scheduler.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/337-mac80211-increase-quantum-for-airtime-scheduler.patch b/package/kernel/mac80211/patches/subsys/337-mac80211-increase-quantum-for-airtime-scheduler.patch new file mode 100644 index 0000000000..74e857679e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/337-mac80211-increase-quantum-for-airtime-scheduler.patch @@ -0,0 +1,53 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Sun, 26 Jun 2022 11:43:25 +0200 +Subject: [PATCH] mac80211: increase quantum for airtime scheduler + +Given the typical AQL budget and queue length, a quantum of 256 with the +default station weight often requires iterating over all queues frequently, +until one of them becomes eligible. +Improve performance by using 8 times station weight as scheduler quantum + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -90,6 +90,8 @@ extern const u8 ieee80211_ac_to_qos_mask + */ + #define AIRTIME_ACTIVE_DURATION (HZ / 10) + ++#define AIRTIME_QUANTUM_SHIFT 3 ++ + struct ieee80211_bss { + u32 device_ts_beacon, device_ts_presp; + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3894,7 +3894,7 @@ struct ieee80211_txq *ieee80211_next_txq + + if (deficit < 0) + sta->airtime[txqi->txq.ac].deficit += +- sta->airtime_weight; ++ sta->airtime_weight << AIRTIME_QUANTUM_SHIFT; + + if (deficit < 0 || !aql_check) { + list_move_tail(&txqi->schedule_order, +@@ -4037,7 +4037,8 @@ bool ieee80211_txq_may_transmit(struct i + } + sta = container_of(iter->txq.sta, struct sta_info, sta); + if (ieee80211_sta_deficit(sta, ac) < 0) +- sta->airtime[ac].deficit += sta->airtime_weight; ++ sta->airtime[ac].deficit += sta->airtime_weight << ++ AIRTIME_QUANTUM_SHIFT; + list_move_tail(&iter->schedule_order, &local->active_txqs[ac]); + } + +@@ -4045,7 +4046,7 @@ bool ieee80211_txq_may_transmit(struct i + if (sta->airtime[ac].deficit >= 0) + goto out; + +- sta->airtime[ac].deficit += sta->airtime_weight; ++ sta->airtime[ac].deficit += sta->airtime_weight << AIRTIME_QUANTUM_SHIFT; + list_move_tail(&txqi->schedule_order, &local->active_txqs[ac]); + spin_unlock_bh(&local->active_txq_lock[ac]); + |