2022-06-26 09:47:12 +00:00
|
|
|
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
|
2024-09-24 13:06:20 +00:00
|
|
|
@@ -103,6 +103,8 @@ ieee80211_sta_keep_active(struct sta_inf
|
2024-06-19 11:51:47 +00:00
|
|
|
return time_before_eq(jiffies, sta->airtime[ac].last_active + HZ / 10);
|
|
|
|
}
|
2022-06-26 09:47:12 +00:00
|
|
|
|
|
|
|
+#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
|
2024-09-24 13:06:20 +00:00
|
|
|
@@ -4081,7 +4081,7 @@ struct ieee80211_txq *ieee80211_next_txq
|
2022-06-26 09:47:12 +00:00
|
|
|
|
|
|
|
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,
|
2024-09-24 13:06:20 +00:00
|
|
|
@@ -4224,7 +4224,8 @@ bool ieee80211_txq_may_transmit(struct i
|
2022-06-26 09:47:12 +00:00
|
|
|
}
|
|
|
|
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]);
|
|
|
|
}
|
|
|
|
|
2024-09-24 13:06:20 +00:00
|
|
|
@@ -4232,7 +4233,7 @@ bool ieee80211_txq_may_transmit(struct i
|
2022-06-26 09:47:12 +00:00
|
|
|
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]);
|
|
|
|
|