All of lore.kernel.org
 help / color / mirror / Atom feed
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>
Subject: Re: [PATCH RFC v5 3/4] mac80211: Add airtime accounting and scheduling to TXQs
Date: Fri, 12 Oct 2018 12:16:13 +0200	[thread overview]
Message-ID: <875zy7qxle.fsf@toke.dk> (raw)
In-Reply-To: <7dfcb7a13a3f75f01f7b88163f2c33d6@codeaurora.org>

Rajkumar Manoharan <rmanohar@codeaurora.org> writes:

> On 2018-10-11 03:38, Toke Høiland-Jørgensen wrote:
>> Rajkumar Manoharan <rmanohar@codeaurora.org> writes:
>> 
>>> Hmm... mine is bit different. txqs are refilled only once for all 
>>> txqs.
>>> It will give more opportunity for non-served txqs. drv_wake_tx_queue
>>> won't be
>>> called from may_tx as the driver anyway will not push packets in
>>> pull-mode.
>> 
>> So, as far as I can tell, this requires the hardware to "keep trying"?
>> I.e., if it just stops scheduling a TXQ after may_transmit() returns
>> false, there is no guarantee that that TXQ will ever get re-awoken
>> unless a new packet arrives for it?
>> 
> That is true and even now ath10k operates the same way in pull mode.
> Not just packet arrival, even napi poll routine tries to pushes the
> packets.

I'm not sure I'm following? At every NAPI poll, the driver tries to push
to *all* TXQs?

> One more thing, fetch indication may pull ~4ms/8ms of packets from
> each tid. This makes deficit too low and so refilling txqs by just
> airtime_weight becomes cumbersome.

Yeah, in general we can't assume that each dequeue uses the same amount
of airtime as the quantum. This is why there's a loop; to fill up
quantum until the first stations gets into the positive.

> In may_transmit, the deficit are incremented by 20 * airtime_weight.
> In future this will be also replaced by station specific quantum. we
> can revisit this once BQL in place. Performance issue is resolved by
> this approach. Do you foresee any issues?

Just using a larger quantum will work as long as all stations send
roughly the same amount of data (airtime) at each transmission. Which is
often the case when you're benchmarking, but not in general. Think of
the size of the quantum as the granularity that the scheduler can
provide fairness at.

What I'd suggest is that instead of increasing the quantum, you do one
of the following:

- Just loop with the smaller quantum until one of the stations go into
  the positive (what we do now).

- Go through all active stations, find the one that is closest being in
  the positive, and add that amount to the quantum. I.e., something
  like (assuming no station has positive deficit; if one does, you don't
  want to add anything anyway):
  
  to_add = -(max(stn.deficit) for stn in active stations)
  for stn in active stations:
    stn.deficit += to_add + stn.weight


-Toke

  reply	other threads:[~2018-10-12 10:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 12:32 [PATCH RFC v5 0/4] Move TXQ scheduling and airtime fairness into mac80211 Toke Høiland-Jørgensen
2018-10-09 12:32 ` [PATCH RFC v5 2/4] cfg80211: Add airtime statistics and settings Toke Høiland-Jørgensen
2018-10-09 12:32 ` [PATCH RFC v5 1/4] mac80211: Add TXQ scheduling API Toke Høiland-Jørgensen
2018-10-09 12:32 ` [PATCH RFC v5 4/4] ath9k: Switch to mac80211 TXQ scheduling and airtime APIs Toke Høiland-Jørgensen
2018-10-09 12:32 ` [PATCH RFC v5 3/4] mac80211: Add airtime accounting and scheduling to TXQs Toke Høiland-Jørgensen
2018-10-10  4:52   ` Rajkumar Manoharan
2018-10-10 11:15     ` Toke Høiland-Jørgensen
2018-10-10 23:20       ` Rajkumar Manoharan
2018-10-11 10:38         ` Toke Høiland-Jørgensen
2018-10-12  7:38           ` Rajkumar Manoharan
2018-10-12 10:16             ` Toke Høiland-Jørgensen [this message]
2018-10-16  7:07               ` Rajkumar Manoharan
2018-10-16 10:20                 ` Toke Høiland-Jørgensen
2018-10-13  7:09             ` [Make-wifi-fast] " Dave Taht

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

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

  git send-email \
    --in-reply-to=875zy7qxle.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=kyan@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.