From: Tim Shepard <shep@alum.mit.edu>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH] ath9k: Switch to using mac80211 intermediate software queues.
Date: Sun, 19 Jun 2016 03:17:42 -0000 [thread overview]
Message-ID: <E1bETEY-0000BM-00@www.xplot.org> (raw)
In-Reply-To: Your message of Sat, 18 Jun 2016 21:05:05 +0200. <20160618190505.24038-1-toke@toke.dk>
Oh cool.. I will try to understand this patch thoroughly in the next
couple of days.
My patch (both v1 and v2) have one or two bugs (depending on exactly
how you count bugs and/or my confusion) (that I know of).
At first glance my first bug appears to remain in your reworked patch:
>
> +static struct sk_buff *
> +ath_tid_pull(struct ath_atx_tid *tid)
> +{
> + struct ath_softc *sc = tid->an->sc;
> + struct ieee80211_hw *hw = sc->hw;
> + struct ath_tx_control txctl = {
> + .txq = tid->txq,
> + .sta = tid->an->sta,
> + };
> + struct sk_buff *skb;
> + struct ath_frame_info *fi;
> + int q;
> +
> + if (!tid->has_queued)
> + return NULL;
> +
> + skb = ieee80211_tx_dequeue(hw, container_of((void*)tid, struct ieee80211_txq, drv_priv));
> + if (!skb) {
> + tid->has_queued = false;
> + return NULL;
> + }
> +
> + if (ath_tx_prepare(hw, skb, &txctl)) {
> + ieee80211_free_txskb(hw, skb);
> + return NULL;
> + }
> +
> + q = skb_get_queue_mapping(skb);
> + if (tid->txq == sc->tx.txq_map[q]) {
> + fi = get_frame_info(skb);
> + fi->txq = q;
> + ++tid->txq->pending_frames;
> + }
> +
> + return skb;
> + }
> +
> +
The increment of ->pending_frames lacks a corresponding check against
sc->tx.txq_max_pending to see if we've reached the limit. (Which begs
the question: what to do if it has?)
I discovered this bug doing experiments by trying to turn down the
various /sys/kernel/debug/ieee80211/phy0/ath9k/qlen_* to low numbers
(including as low as one, and then even zero) and found it had no
effect.
OK, so that's one bug.
The second more mysterious bug which I'm still struggling to
understand is why doesn't large values in these ath9k/qlen_* (or more
accurately, given the first bug above, the failure to check these qlen
limit values at all) allow for increased hardware queue bloat (with
observable delay). I suspect that is because the driver with my patch
to use the new intermediate queues is doing something silly like
failing to have more than one aggregate at a time hooked up in the
hardware transmit queue for transmission. But I haven't figured out
what is really happening yet. And this bug (depending on what exactly
it turns out to be) might make the low latency results some of you
have seen somewhat problematic to understand because it might be the
case that with my patch as it is (up to now) there's a flaw that leads
to low latency and gives up some throughput by simply failing to keep
the device busy transmitting packets when there are packets to send.
Fixing this bug might increase latency... my plan all along has been
to put something in akin to autotuning like we have in bql/dql in
wired network interfaces. Note the right amount to queue depends on
CPU performance capability in running the driver... that's why it
needs to be autotuned at run time.
But anyway, Toke, between struggling to understand this second bug and
some distractions I neglected to answer your question of almost two
weeks ago when you said:
> What's the symptom of this? As I said I haven't noticed anything, but it
> might be worth looking out for.
So now I've finally tried to answer that question. Perhaps with your
recent work on this patch your head is loaded with context that might
be helpful in understanding this.
Tomorrow (after I get some sleep) I'm planning on taking a look at
what ath9k looks like with this patch of yours applied and see if that
makes it any easier to figure out what to do about the above bug(s) in
my original patch.
-Tim Shepard
shep at alum.mit.edu
next prev parent reply other threads:[~2016-06-19 3:17 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 9:09 [ath9k-devel] [PATCH 0/2] ath9k: Add airtime fairness scheduler Toke Høiland-Jørgensen
2016-06-17 9:09 ` [ath9k-devel] [PATCH 1/2] ath9k: use mac80211 intermediate software queues Toke Høiland-Jørgensen
2016-06-17 13:28 ` Felix Fietkau
2016-06-17 13:43 ` Toke Høiland-Jørgensen
2016-06-17 13:48 ` Felix Fietkau
2016-06-17 16:33 ` Felix Fietkau
2016-06-17 14:08 ` Tim Shepard
2016-06-17 14:35 ` Felix Fietkau
2016-06-17 17:45 ` Tim Shepard
2016-06-17 19:16 ` Toke Høiland-Jørgensen
2016-06-17 14:10 ` Dave Taht
2016-06-18 19:06 ` [ath9k-devel] [PATCH] ath9k: Switch to using " Toke Høiland-Jørgensen
2016-06-19 3:17 ` Tim Shepard [this message]
2016-06-19 8:52 ` Toke Høiland-Jørgensen
2016-06-19 13:40 ` Tim Shepard
2016-06-19 13:50 ` Toke Høiland-Jørgensen
2016-07-03 3:53 ` Tim Shepard
2016-07-04 17:47 ` Toke Høiland-Jørgensen
2016-07-06 13:23 ` Felix Fietkau
2016-07-06 14:46 ` Toke Høiland-Jørgensen
2016-07-06 16:17 ` [ath9k-devel] [PATCH v2] " Toke Høiland-Jørgensen
2016-07-06 18:13 ` Felix Fietkau
2016-07-06 18:52 ` Toke Høiland-Jørgensen
2016-07-06 18:59 ` Felix Fietkau
2016-07-06 19:08 ` Toke Høiland-Jørgensen
2016-07-06 18:19 ` Sebastian Gottschall
2016-07-06 19:38 ` [ath9k-devel] [PATCH v3] " Toke Høiland-Jørgensen
2016-07-08 14:26 ` [ath9k-devel] [v3] " Kalle Valo
2016-07-08 15:53 ` Toke Høiland-Jørgensen
2016-07-08 16:10 ` Felix Fietkau
2016-07-08 16:28 ` Toke Høiland-Jørgensen
2016-07-08 16:31 ` Felix Fietkau
2016-07-08 16:38 ` Toke Høiland-Jørgensen
2016-07-08 18:24 ` Sebastian Gottschall
2016-07-09 12:00 ` Toke Høiland-Jørgensen
2016-07-08 16:38 ` [ath9k-devel] [PATCH v3] " Tim Shepard
2016-07-09 15:45 ` Toke Høiland-Jørgensen
2016-08-05 16:05 ` [ath9k-devel] [PATCH v4] " Toke Høiland-Jørgensen
2016-08-22 15:43 ` Kalle Valo
2016-08-22 16:16 ` Toke Høiland-Jørgensen
2016-08-22 17:02 ` Kalle Valo
2016-08-22 17:13 ` Toke Høiland-Jørgensen
2016-08-23 6:59 ` Kalle Valo
2016-08-23 8:58 ` Arend van Spriel
2016-10-05 14:09 ` Toke Høiland-Jørgensen
2016-10-05 15:50 ` Kalle Valo
2016-10-05 16:55 ` Toke Høiland-Jørgensen
2016-10-05 17:54 ` Kalle Valo
2016-10-05 19:56 ` Toke Høiland-Jørgensen
2016-06-17 9:09 ` [ath9k-devel] [PATCH 2/2] ath9k: Add a per-station airtime deficit scheduler 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1bETEY-0000BM-00@www.xplot.org \
--to=shep@alum.mit.edu \
--cc=ath9k-devel@lists.ath9k.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;
as well as URLs for NNTP newsgroup(s).