Lets make wifi fast again!
 help / color / mirror / Atom feed
From: Kan Yan <kyan@google.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>,
	Johannes Berg <johannes@sipsolutions.net>,
	 linux-wireless@vger.kernel.org,
	make-wifi-fast@lists.bufferbloat.net,
	 John Crispin <john@phrozen.org>,
	Lorenzo Bianconi <lorenzo@kernel.org>
Subject: Re: [Make-wifi-fast] [PATCH RFC/RFT 4/4] mac80211: Apply Airtime-based Queue Limit (AQL) on packet dequeue
Date: Thu, 26 Sep 2019 19:42:49 -0700	[thread overview]
Message-ID: <CA+iem5uir8GOq2psAVuUParY3MimsGhvdefUopiwHov128CQQA@mail.gmail.com> (raw)
In-Reply-To: <87tv8z13wv.fsf@toke.dk>

> No, but on tx_completion we could do something like this:
> airtime = CB(skb)->tx_time ?: CB(skb)->tx_time_est;
> ieee80211_report_airtime(sta, airtime);
> That way, if the driver sets the tx_time field to something the firmware
> reports, we'll use that, and otherwise we'd fall back to the estimate.
> Of course, there would need to be a way for the driver to opt out of
> this, for drivers that report out of band airtime like ath10k does :)

I doubt that will work, unless firmware can do per frame airtime
update in the skb. It is more likely that firmware provides out of
band airtime update for a period of time, like an aggregation. That's
the case for ath10k: https://patchwork.kernel.org/patch/10684689

Regarding handling frame for station enters power saving mode:
>
> >> Oh, right. Didn't know that could happen (I assumed those would be
> >> flushed out or something). But if we're going to go with Kan's
> >> suggestion of having per-station accounting as well as a global
> >> accounting for the device, we could just subtract the station's
> >> outstanding balance from the device total when it goes into powersave
> >> mode, and add it back once it wakes up again. At least I think that
> >> would work, no?
> >Yes, I think that would work.
> Great! Will incorporate that, then.

I think that could work but things could be a bit more complicated.
Not sure I fully understand the usage of airtime_weight_sum in  [PATCH
V3 1/4] mac80211: Switch to a virtual time-based airtime scheduler:

in ieee80211_schedule_txq():
   local->airtime_weight_sum[ac] += sta->airtime_weight;

in ieee80211_sta_register_airtime():
   weight_sum = local->airtime_weight_sum[ac] ?: sta->airtime_weight;
   local->airtime_v_t[ac] += airtime / weight_sum;
   sta->airtime[ac].v_t += airtime / sta->airtime_weight;

in  __ieee80211_unschedule_txq
 local->airtime_weight_sum[ac] -= sta->airtime_weight;

I assume the purpose of airtime_weight_sum is to count station's
virtual airtime proportional to the number of active stations for
fairness.  My concern is the per interface
local->airtime_weight_sum[ac] get updated when packets are released
from a txq to lower layer, but it doesn't mean the airtime will be
consumed (packets get transmitted) shortly, due to events like station
enter power save mode, so the weight_sum used in
ieee80211_sta_register_airtime() maybe inaccurate. For architects
using firmware/hardware offloading, firmware ultimately controls
packet scheduling and has quite a lot of autonomy. The host driver's
airtime_weight_sum may get out of sync with the number of active
stations actually scheduled by firmware even without power saving
events.

Is this a correct understanding? I kind of think the original method
of airtime accounting using deficit maybe more robust in this regard.

  reply	other threads:[~2019-09-27  2:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 12:22 [Make-wifi-fast] [PATCH RFC/RFT 0/4] Add Airtime Queue Limits (AQL) to mac80211 Toke Høiland-Jørgensen
2019-09-19 12:22 ` [Make-wifi-fast] [PATCH RFC/RFT 1/4] mac80211: Rearrange ieee80211_tx_info to make room for tx_time_est Toke Høiland-Jørgensen
2019-10-01  8:44   ` Johannes Berg
2019-10-01  9:08     ` Toke Høiland-Jørgensen
2019-10-01  9:12       ` Johannes Berg
2019-10-01  9:39         ` Toke Høiland-Jørgensen
2019-09-19 12:22 ` [Make-wifi-fast] [PATCH RFC/RFT 2/4] mac80211: Add API function to set the last TX bitrate for a station Toke Høiland-Jørgensen
2019-10-01  8:46   ` Johannes Berg
2019-10-01  9:09     ` Toke Høiland-Jørgensen
2019-09-19 12:22 ` [Make-wifi-fast] [PATCH RFC/RFT 3/4] ath10k: Pass last TX bitrate up to mac80211 Toke Høiland-Jørgensen
2019-09-19 12:22 ` [Make-wifi-fast] [PATCH RFC/RFT 4/4] mac80211: Apply Airtime-based Queue Limit (AQL) on packet dequeue Toke Høiland-Jørgensen
2019-09-19 17:44   ` Peter Oh
     [not found]     ` <879913e9-4254-1381-07f6-d860fb0b8de0@candelatech.com>
2019-09-19 17:54       ` Peter Oh
2019-09-19 18:03         ` Peter Oh
2019-09-19 18:18           ` Dave Taht
2019-09-19 20:09             ` John Yates
2019-09-19 20:15               ` Toke Høiland-Jørgensen
2019-09-19 18:03         ` Toke Høiland-Jørgensen
2019-09-20 12:06   ` Lorenzo Bianconi
2019-09-20 12:54     ` Toke Høiland-Jørgensen
2019-09-20 13:06       ` Lorenzo Bianconi
2019-09-20 13:32         ` Toke Høiland-Jørgensen
2019-09-20 22:38           ` Kan Yan
2019-09-20 22:55           ` Kan Yan
2019-09-21 12:11             ` Toke Høiland-Jørgensen
2019-09-25  7:37   ` Yibo Zhao
2019-09-25  8:11     ` Toke Høiland-Jørgensen
2019-09-25 11:54       ` Yibo Zhao
2019-09-25 12:52         ` Toke Høiland-Jørgensen
2019-09-26  0:27           ` Kan Yan
2019-09-26  0:34             ` Kan Yan
2019-09-26  5:57               ` Toke Høiland-Jørgensen
2019-09-26  6:04             ` Toke Høiland-Jørgensen
2019-09-26 12:53   ` Felix Fietkau
2019-09-26 13:17     ` Toke Høiland-Jørgensen
2019-09-26 13:47       ` Felix Fietkau
2019-09-26 15:19         ` Toke Høiland-Jørgensen
2019-09-27  2:42           ` Kan Yan [this message]
2019-09-27  6:12             ` Toke Høiland-Jørgensen
2019-09-27  9:20               ` Yibo Zhao
2019-09-28 20:24                 ` Kan Yan
2019-09-29 19:18                   ` Toke Høiland-Jørgensen
2019-10-01  4:47                     ` Kan Yan
2019-10-01  6:57                       ` Toke Høiland-Jørgensen
2019-09-19 14:12 ` [Make-wifi-fast] [PATCH RFC/RFT 0/4] Add Airtime Queue Limits (AQL) to mac80211 Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/make-wifi-fast.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+iem5uir8GOq2psAVuUParY3MimsGhvdefUopiwHov128CQQA@mail.gmail.com \
    --to=kyan@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=john@phrozen.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=make-wifi-fast@lists.bufferbloat.net \
    --cc=nbd@nbd.name \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox