From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Rajkumar Manoharan <rmanohar@codeaurora.org>
Cc: linux-wireless@vger.kernel.org,
make-wifi-fast@lists.bufferbloat.net,
Felix Fietkau <nbd@nbd.name>, Kan Yan <kyan@google.com>,
linux-wireless-owner@vger.kernel.org
Subject: Re: [Make-wifi-fast] [PATCH RFC v4 1/4] mac80211: Add TXQ scheduling API
Date: Wed, 19 Sep 2018 11:09:06 +0200 [thread overview]
Message-ID: <87y3bxkg5p.fsf@toke.dk> (raw)
In-Reply-To: <5e2612cbd4ea9f560a63149c599f8587@codeaurora.org>
Rajkumar Manoharan <rmanohar@codeaurora.org> writes:
> On 2018-09-18 13:41, Toke Høiland-Jørgensen wrote:
>> Rajkumar Manoharan <rmanohar@codeaurora.org> writes:
>>
>>>>> Also an option to add the node at head or tail would be preferred.
>>>>> If
>>>>> return_txq adds node at head of list, then it is forcing the driver
>>>>> to
>>>>> serve same txq until it becomes empty. Also this will not allow the
>>>>> driver to send N frames from each txqs.
>>>>
>>>> The whole point of this patch set is to move those kinds of decisions
>>>> out of the driver and into mac80211. The airtime scheduler won't
>>>> achieve
>>>> fairness if it allows queues to be queued to the end of the rotation
>>>> before its deficit turns negative. And obviously there's some lag in
>>>> this since we're using after-the-fact airtime information.
>>>>
>>> Hmm.. As you know ath10k kind of doing fairness by serving fixed
>>> frames
>>> from each txq. This approach will be removed from ath10k.
>>>
>>>> For ath9k this has not really been a problem in my tests; if the lag
>>>> turns out to be too great for ath10k (which I suppose is a
>>>> possibility
>>>> since we don't get airtime information on every TX-compl), I figure
>>>> we
>>>> can use the same estimated airtime value that is used for throttling
>>>> the
>>>> queues to adjust the deficit immediately...
>>>>
>>> Thats true. I am porting Kan's changes of airtime estimation for each
>>> msdu for firmware that does not report airtime.
>>
>> Right. My thinking with this was that we could put the per-frame
>> airtime
>> estimation into ieee80211_tx_dequeue(), which could track the
>> outstanding airtime and just return NULL if it goes over the threshold.
>> I think this is fairly straight-forward to do on its own; the biggest
>> problem is probably finding the space in the mac80211 cb?
>>
>> Is this what you are working on porting? Because then I'll wait for
>> your
>> patch rather than starting to write this code myself :)
>>
> Kind of.. something like below.
>
> tx_dequeue(){
> compute airtime_est from last_tx_rate
> if (sta->airtime[ac].deficit < airtime_est)
> return NULL;
> dequeue skb and store airtime_est in cb
> }
I think I would decouple it further and not use the deficit. But rather:
tx_dequeue(){
if (sta->airtime[ac].outstanding > AIRTIME_OUTSTANDING_MAX)
return NULL
compute airtime_est from last_tx_rate
dequeue skb and store airtime_est in cb
sta->airtime[ac].outstanding += airtime_est;
}
> Unfortunately ath10k is not reporting last_tx_rate in tx_status(). So
> I also applied this "ath10k: report tx rate using ieee80211_tx_status"
> change.
Yeah, that and the patch that computes the last used rate will probably
be necessary; but they can be pretty much applied as-is, right?
>> This mechanism on its own will get us the queue limiting and latency
>> reduction goodness for firmwares with deep queues. And for that it can
>> be completely independent of the airtime fairness scheduler, which can
>> use the after-tx-compl airtime information to presumably get more
>> accurate fairness which includes retransmissions etc.
>>
>> Now, we could *also* use the ahead-of-time airtime estimation for
>> fairness; either just as a fallback for drivers that can't get actual
>> airtime usage information for the hardware, or as an alternative in
>> cases where it works better for other reasons. But I think that
>> separating the two in the initial implementation makes more sense; that
>> will make it easier to experiment with different combinations of the
>> two.
>>
>> Does that make sense? :)
>>
> Completely agree. I was thinking of using this as fallback for devices
> that does not report airtime but tx rate.
Great! Seems we are converging on a workable solution, then :)
-Toke
next prev parent reply other threads:[~2018-09-19 9:09 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-16 17:42 [Make-wifi-fast] [PATCH RFC v4 0/4] Move TXQ scheduling into mac80211 Toke Høiland-Jørgensen
2018-09-16 17:42 ` [Make-wifi-fast] [PATCH RFC v4 1/4] mac80211: Add TXQ scheduling API Toke Høiland-Jørgensen
2018-09-18 0:57 ` Rajkumar Manoharan
2018-09-18 10:29 ` Toke Høiland-Jørgensen
2018-09-18 18:51 ` Rajkumar Manoharan
2018-09-18 20:41 ` Toke Høiland-Jørgensen
2018-09-18 21:30 ` Rajkumar Manoharan
2018-09-19 9:09 ` Toke Høiland-Jørgensen [this message]
2018-09-19 14:43 ` Kalle Valo
2018-09-19 14:50 ` Toke Høiland-Jørgensen
2018-09-19 16:54 ` Rajkumar Manoharan
2018-09-16 17:42 ` [Make-wifi-fast] [PATCH RFC v4 2/4] cfg80211: Add airtime statistics and settings Toke Høiland-Jørgensen
2018-09-16 17:42 ` [Make-wifi-fast] [PATCH RFC v4 3/4] mac80211: Add airtime accounting and scheduling to TXQs Toke Høiland-Jørgensen
2018-09-26 7:09 ` Rajkumar Manoharan
2018-09-26 9:22 ` Toke Høiland-Jørgensen
2018-09-27 0:09 ` Rajkumar Manoharan
2018-09-28 5:29 ` Rajkumar Manoharan
2018-09-28 7:51 ` Toke Høiland-Jørgensen
2018-09-28 9:27 ` Rajkumar Manoharan
2018-09-28 9:44 ` Rajkumar Manoharan
2018-09-28 9:58 ` Toke Høiland-Jørgensen
2018-09-28 10:19 ` Rajkumar Manoharan
2018-09-28 10:35 ` Jonathan Morton
2018-09-28 10:47 ` Rajkumar Manoharan
2018-09-28 11:02 ` Toke Høiland-Jørgensen
2018-09-28 19:51 ` Rajkumar Manoharan
2018-10-02 6:58 ` Rajkumar Manoharan
2018-10-02 7:41 ` Rajkumar Manoharan
2018-10-02 8:22 ` Toke Høiland-Jørgensen
2018-10-02 16:33 ` Rajkumar Manoharan
2018-10-02 19:00 ` Toke Høiland-Jørgensen
2018-10-02 23:07 ` Rajkumar Manoharan
2018-10-03 5:53 ` Rajkumar Manoharan
2018-10-03 6:27 ` Rajkumar Manoharan
2018-10-03 8:41 ` Toke Høiland-Jørgensen
2018-09-16 17:42 ` [Make-wifi-fast] [PATCH RFC v4 4/4] ath9k: Switch to mac80211 TXQ scheduling and airtime APIs Toke Høiland-Jørgensen
2018-09-20 21:29 ` [Make-wifi-fast] [PATCH RFC v4 0/4] Move TXQ scheduling into mac80211 Rajkumar Manoharan
2018-09-21 12:41 ` 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=87y3bxkg5p.fsf@toke.dk \
--to=toke@toke.dk \
--cc=kyan@google.com \
--cc=linux-wireless-owner@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=make-wifi-fast@lists.bufferbloat.net \
--cc=nbd@nbd.name \
--cc=rmanohar@codeaurora.org \
/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