Lets make wifi fast again!
 help / color / mirror / Atom feed
From: Rajkumar Manoharan <rmanohar@codeaurora.org>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Jonathan Morton <chromatix99@gmail.com>,
	Kan Yan <kyan@google.com>,
	make-wifi-fast@lists.bufferbloat.net,
	linux-wireless-owner@vger.kernel.org,
	linux-wireless@vger.kernel.org, Felix Fietkau <nbd@nbd.name>
Subject: Re: [Make-wifi-fast] [PATCH RFC v4 3/4] mac80211: Add airtime accounting and scheduling to TXQs
Date: Tue, 02 Oct 2018 22:53:32 -0700	[thread overview]
Message-ID: <08dabe69e625c11f70b217ae9695c7f4@codeaurora.org> (raw)
In-Reply-To: <30cf3754fa970aa1af11791c2625a7c9@codeaurora.org>

On 2018-10-02 16:07, Rajkumar Manoharan wrote:
> On 2018-10-02 12:00, Toke Høiland-Jørgensen wrote:
>> Rajkumar Manoharan <rmanohar@codeaurora.org> writes:
>>> I noticed a race condition b/w sta cleanup and kick_airtime tasklet.
>>>>> How do you plan to exit kick_airtime gracefully during sta_cleanup?
>>>> 
>>>> Ah, right, there's a lot of stuff going on before we get to 
>>>> purge_txq.
>>>> Hmm, I guess we should either make sure we remove the station from
>>>> active_txqs earlier in the sta cleanup process, or maybe it'd enough 
>>>> to
>>>> just check the removed flag in the tasklet?
>>>> 
>>>> Does the below patch fix the issue?
>>>> 
>>> 
>>> No. Attaching backtrace. Any clue?
>> 
>> Ah, that's my bad. Just having a 'continue' there can make the 
>> function
>> loop forever. Oops. Try something like this instead?
>> 
> 
> But 'continue' also used in other places. Will give a try but I think 
> that
> calling drv_wake_tx_queue within iteration is dangerous as it alters
> the list. no?
> 
How about below change? Just schedule first txq and remaining will be
scheduled later by driver upon tx-compl.

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 0bb590928dd0..2dbfd1d8eb5f 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -242,6 +242,7 @@ EXPORT_SYMBOL(ieee80211_ctstoself_duration);

  static void __ieee80211_kick_airtime(struct ieee80211_local *local, int 
ac)
  {
+       struct ieee80211_txq *txq;
         bool seen_eligible = false;
         struct txq_info *txqi;
         struct sta_info *sta;
@@ -261,14 +262,7 @@ static void __ieee80211_kick_airtime(struct 
ieee80211_local *local, int ac)

                 if (sta->airtime[ac].deficit >= 0) {
                         seen_eligible = true;
-
-                       if 
(!test_and_clear_bit(IEEE80211_TXQ_AIRTIME_THROTTLE,
-                                               &txqi->flags))
-                               continue;
-
-                       spin_unlock_bh(&local->active_txq_lock[ac]);
-                       drv_wake_tx_queue(local, txqi);
-                       spin_lock_bh(&local->active_txq_lock[ac]);
+                       clear_bit(IEEE80211_TXQ_AIRTIME_THROTTLE, 
&txqi->flags);
                 }
         }

@@ -289,8 +283,10 @@ static void __ieee80211_kick_airtime(struct 
ieee80211_local *local, int ac)
         }
   out:
         rcu_read_unlock();
+       txq = ieee80211_next_txq(&local->hw, ac);
         spin_unlock_bh(&local->active_txq_lock[ac]);
-
+       if (txq)
+               drv_wake_tx_queue(local, to_txq_info(txq));
  }

-Rajkumar

  reply	other threads:[~2018-10-03  5:53 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 4/4] ath9k: Switch to mac80211 TXQ scheduling and airtime APIs 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 [this message]
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 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
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-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=08dabe69e625c11f70b217ae9695c7f4@codeaurora.org \
    --to=rmanohar@codeaurora.org \
    --cc=chromatix99@gmail.com \
    --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=toke@toke.dk \
    /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