diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-06-25 23:24:11 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-07-01 10:51:48 +0200 |
commit | c77bfab9237109d93162d9fce0d69f97aed5dc40 (patch) | |
tree | d9c5ae3fab8c4588f5d43f83e75c18a79fdd1127 /net/mac80211/sta_info.c | |
parent | wifi: mac80211: add debugfs file to display per-phy AQL pending airtime (diff) | |
download | linux-c77bfab9237109d93162d9fce0d69f97aed5dc40.tar.xz linux-c77bfab9237109d93162d9fce0d69f97aed5dc40.zip |
wifi: mac80211: only accumulate airtime deficit for active clients
When a client does not generate any local tx activity, accumulating airtime
deficit for the round-robin scheduler can be harmful. If this goes on for too
long, the deficit could grow quite large, which might cause unreasonable
initial latency once the client becomes active
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://lore.kernel.org/r/20220625212411.36675-7-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to '')
-rw-r--r-- | net/mac80211/sta_info.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 28ab55a072c6..c9852f71e8e1 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2046,6 +2046,7 @@ void ieee80211_sta_register_airtime(struct ieee80211_sta *pubsta, u8 tid, struct ieee80211_local *local = sta->sdata->local; u8 ac = ieee80211_ac_from_tid(tid); u32 airtime = 0; + u32 diff; if (sta->local->airtime_flags & AIRTIME_USE_TX) airtime += tx_airtime; @@ -2055,7 +2056,11 @@ void ieee80211_sta_register_airtime(struct ieee80211_sta *pubsta, u8 tid, spin_lock_bh(&local->active_txq_lock[ac]); sta->airtime[ac].tx_airtime += tx_airtime; sta->airtime[ac].rx_airtime += rx_airtime; - sta->airtime[ac].deficit -= airtime; + + diff = (u32)jiffies - sta->airtime[ac].last_active; + if (diff <= AIRTIME_ACTIVE_DURATION) + sta->airtime[ac].deficit -= airtime; + spin_unlock_bh(&local->active_txq_lock[ac]); } EXPORT_SYMBOL(ieee80211_sta_register_airtime); |