1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-17 04:33:57 +02:00
openwrt/package/kernel/mac80211/patches/subsys/306-mac80211-use-coarse-boottime-for-airtime-fairness-co.patch
Hauke Mehrtens 06ea586508 mac80211: Update to 5.15.153-1
Update mac80211 to version based on kernel 5.15.153.
This contains multiple bugfixes.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-04-21 17:29:57 +02:00

61 lines
2.0 KiB
Diff

From: Felix Fietkau <nbd@nbd.name>
Date: Tue, 14 Dec 2021 17:53:12 +0100
Subject: [PATCH] mac80211: use coarse boottime for airtime fairness code
The time values used by the airtime fairness code only need to be accurate
enough to cover station activity detection.
Using ktime_get_coarse_boottime_ns instead of ktime_get_boottime_ns will
drop the accuracy down to jiffies intervals, but at the same time saves
a lot of CPU cycles in a hot path
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3822,7 +3822,7 @@ struct ieee80211_txq *ieee80211_next_txq
{
struct ieee80211_local *local = hw_to_local(hw);
struct airtime_sched_info *air_sched;
- u64 now = ktime_get_boottime_ns();
+ u64 now = ktime_get_coarse_boottime_ns();
struct ieee80211_txq *ret = NULL;
struct airtime_info *air_info;
struct txq_info *txqi = NULL;
@@ -3949,7 +3949,7 @@ void ieee80211_update_airtime_weight(str
u64 weight_sum = 0;
if (unlikely(!now))
- now = ktime_get_boottime_ns();
+ now = ktime_get_coarse_boottime_ns();
lockdep_assert_held(&air_sched->lock);
@@ -3975,7 +3975,7 @@ void ieee80211_schedule_txq(struct ieee8
struct ieee80211_local *local = hw_to_local(hw);
struct txq_info *txqi = to_txq_info(txq);
struct airtime_sched_info *air_sched;
- u64 now = ktime_get_boottime_ns();
+ u64 now = ktime_get_coarse_boottime_ns();
struct airtime_info *air_info;
u8 ac = txq->ac;
bool was_active;
@@ -4033,7 +4033,7 @@ static void __ieee80211_unschedule_txq(s
if (!purge)
airtime_set_active(air_sched, air_info,
- ktime_get_boottime_ns());
+ ktime_get_coarse_boottime_ns());
rb_erase_cached(&txqi->schedule_order,
&air_sched->active_txqs);
@@ -4121,7 +4121,7 @@ bool ieee80211_txq_may_transmit(struct i
if (RB_EMPTY_NODE(&txqi->schedule_order))
goto out;
- now = ktime_get_boottime_ns();
+ now = ktime_get_coarse_boottime_ns();
/* Like in ieee80211_next_txq(), make sure the first station in the
* scheduling order is eligible for transmission to avoid starvation.