From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org,
make-wifi-fast@lists.bufferbloat.net
Cc: Rajkumar Manoharan <rmanohar@codeaurora.org>,
Felix Fietkau <nbd@nbd.name>
Subject: Re: [Make-wifi-fast] [PATCH RFC v3 1/4] mac80211: Add TXQ scheduling API
Date: Mon, 10 Sep 2018 17:00:11 +0200 [thread overview]
Message-ID: <87muspjt38.fsf@toke.dk> (raw)
In-Reply-To: <1536591110.3224.76.camel@sipsolutions.net>
Johannes Berg <johannes@sipsolutions.net> writes:
> On Mon, 2018-09-10 at 15:18 +0200, Toke Høiland-Jørgensen wrote:
>
>> If we have the start_schedule() / end_schedule() pair anyway, the latter
>> could notify any TXQs that became eligible during the scheduling round.
>
> Do we even need end_schedule()? It's hard to pass multiple things to a
> single call (do you build a list?), so having
>
> start_schedule(), get_txq(), return_txq()
>
> would be sufficient?
Well, start_schedule() / end_schedule() would be needed if we are going
to add locking in mac80211?
>> Also, instead of having the three different API functions
>> (next_txq()/may_tx()/schedule_txq()), we could have get_txq(txq)/put_txq(txq)
>> which would always need to be paired; but the argument to get_txq()
>> could be optional, and if the driver passes NULL it means "give me the
>> next available TXQ".
>
> I can't say I like this. It makes the meaning totally different:
>
> * with NULL: use the internal scheduler to determine which one is good
> to use next
> * non-NULL: essentially equivalent to may_tx()
Yeah, it'll be two completely different uses for the same function; but
there wouldn't be two different APIs to keep track of. I'm fine with
keeping them as separately named functions. :)
>> So for ath9k it would be:
>>
>>
>> start_schedule(ac);
>> while ((txq = get_txq(NULL)) {
>> queue_aggregate(txq);
>> put_txq(txq);
>> }
>> end_schedule(ac);
>>
>> And for ath10k/iwlwifi it would be:
>>
>> on_hw_notify(txq) {
>> start_schedule(ac);
>> if (txq = get_txq(txq)) {
>> queue_packets(txq);
>> put_txq(txq);
>> }
>> end_schedule(ac);
>> }
>>
>>
>> I think that would be simpler, API-wise?
>
> I can't say I see much point in overloading get_txq() that way. You'd
> never use it the same way.
>
> Also, would you really start_schedule(ac) in the hw-managed case?
If we decide mac80211 needs to do locking to prevent two threads from
scheduling the same ac, that would also be needed for the hw-managed
case?
> It seems like not? Basically it seems to me that in the hw-managed
> case all you need is may_tx()? And in fact, once you opt in you don't
> even really need *that* since mac80211 can just return NULL from
> get_skb()?
Yeah, we could just throttle in get_skb(); the separate call was to
avoid the overhead of the check for every packet. Typically, you'll pick
a TXQ, then dequeue multiple packets from it in succession; with a
separate call to may_tx(), you only do the check once, not for every
packet...
-Toke
next prev parent reply other threads:[~2018-09-10 15:00 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 22:22 [Make-wifi-fast] [PATCH RFC v3 0/4] Move TXQ scheduling into mac80211 Toke Høiland-Jørgensen
2018-09-07 22:22 ` [Make-wifi-fast] [PATCH RFC v3 1/4] mac80211: Add TXQ scheduling API Toke Høiland-Jørgensen
2018-09-10 7:48 ` Johannes Berg
2018-09-10 10:57 ` Toke Høiland-Jørgensen
2018-09-10 11:03 ` Johannes Berg
2018-09-10 12:39 ` Toke Høiland-Jørgensen
2018-09-10 12:46 ` Johannes Berg
2018-09-10 13:08 ` Toke Høiland-Jørgensen
2018-09-10 13:10 ` Johannes Berg
2018-09-10 13:18 ` Toke Høiland-Jørgensen
2018-09-10 14:51 ` Johannes Berg
2018-09-10 15:00 ` Toke Høiland-Jørgensen [this message]
2018-09-11 9:20 ` Johannes Berg
2018-09-11 9:48 ` Toke Høiland-Jørgensen
2018-09-10 8:04 ` Johannes Berg
2018-09-10 11:02 ` Toke Høiland-Jørgensen
2018-09-10 11:12 ` Johannes Berg
2018-09-07 22:22 ` [Make-wifi-fast] [PATCH RFC v3 2/4] mac80211: Add airtime accounting and scheduling to TXQs Toke Høiland-Jørgensen
2018-09-10 8:18 ` Johannes Berg
2018-09-10 11:13 ` Toke Høiland-Jørgensen
2018-09-10 11:22 ` Johannes Berg
2018-09-12 0:07 ` Rajkumar Manoharan
2018-09-12 11:10 ` Toke Høiland-Jørgensen
2018-09-12 16:23 ` Rajkumar Manoharan
2018-09-07 22:22 ` [Make-wifi-fast] [PATCH RFC v3 4/4] ath9k: Switch to mac80211 TXQ scheduling and airtime APIs Toke Høiland-Jørgensen
2018-09-07 22:22 ` [Make-wifi-fast] [PATCH RFC v3 3/4] cfg80211: Add airtime statistics and settings Toke Høiland-Jørgensen
2018-09-10 8:23 ` Johannes Berg
2018-09-10 11:15 ` Toke Høiland-Jørgensen
2018-09-09 22:08 ` [Make-wifi-fast] [PATCH RFC v3 0/4] Move TXQ scheduling into mac80211 Kan Yan
2018-09-10 10:52 ` Toke Høiland-Jørgensen
2018-09-10 7:46 ` Johannes Berg
2018-09-10 11:16 ` Toke Høiland-Jørgensen
2018-09-10 11:24 ` Johannes Berg
2018-09-10 7:52 ` Johannes Berg
2018-09-10 11:17 ` Toke Høiland-Jørgensen
2018-09-10 11:26 ` Johannes Berg
2018-09-13 4:10 ` Kan Yan
2018-09-13 9:25 ` 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=87muspjt38.fsf@toke.dk \
--to=toke@toke.dk \
--cc=johannes@sipsolutions.net \
--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