All of lore.kernel.org
 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 00:41:28 -0700	[thread overview]
Message-ID: <f2b31489b65fc0ce106b45e9938b4794@codeaurora.org> (raw)
In-Reply-To: <0531def170ef7f9cadcf85a6dc9af22b@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

On 2018-10-01 23:58, Rajkumar Manoharan wrote:
>> Great! I'll fold in the rest, test it with ath9k and submit as a 
>> proper patch :)
>> 
> Toke,
> 
> 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?
> 
If kick_airtime tasklet is only used for adjusting deficit for all 
throttled txq,
then below rcu lock issue is not observed. I am testing with 50 clients 
and the
crash happens only during sta cleanup. Releasing active_txq_lock from 
tasklet is
yielding handle to txq_purge(). I am thinking of get rid of tasklet and 
handle
adjustment directly in API.


diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 0bb590928dd0..277dbf8e0a4b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -261,14 +261,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);

-Rajkumar

[-- Attachment #2: rcu_race.txt --]
[-- Type: text/plain, Size: 2571 bytes --]



root@OpenWrt:/# [  363.094702] INFO: rcu_preempt self-detected stall on CPU { 0}
  (t=2101 jiffies g=2679 c=2678 q=134)
[  363.102709] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.77 #9
[  363.104717] INFO: rcu_preempt detected stalls on CPUs/tasks: { 0} (detected b
y 1, t=2102 jiffies, g=2679, c=2678, q=134)
[  363.104723] Task dump for CPU 0:
[  363.104734] swapper/0       R running      0     0      0 0x00001002
[  363.104763] [<c020ec20>] (__schedule) from [<c0218304>] (arch_cpu_idle+0x38/0
x5c)
[  363.104852] [<c0218304>] (arch_cpu_idle) from [<ffffffff>] (0xffffffff)
[  363.143167] [<c021d9ac>] (unwind_backtrace) from [<c021aa40>] (show_stack+0x1
0/0x14)
[  363.150892] [<c021aa40>] (show_stack) from [<c03c59d4>] (dump_stack+0x80/0xa0
)
[  363.158099] [<c03c59d4>] (dump_stack) from [<c026e1dc>] (rcu_check_callbacks+
0x230/0x6a8)
[  363.166258] [<c026e1dc>] (rcu_check_callbacks) from [<c0238814>] (update_proc
ess_times+0x38/0x58)
[  363.175110] [<c0238814>] (update_process_times) from [<c0276780>] (tick_sched
_timer+0x44/0x74)
[  363.183702] [<c0276780>] (tick_sched_timer) from [<c024a828>] (__run_hrtimer+
0x50/0xc8)
[  363.191686] [<c024a828>] (__run_hrtimer) from [<c024aff8>] (hrtimer_interrupt
+0x130/0x27c)
[  363.199936] [<c024aff8>] (hrtimer_interrupt) from [<c05175ac>] (msm_timer_int
errupt+0x38/0x44)
[  363.208528] [<c05175ac>] (msm_timer_interrupt) from [<c0268a6c>] (handle_perc
pu_devid_irq+0x68/0x84)
[  363.217645] [<c0268a6c>] (handle_percpu_devid_irq) from [<c02653e0>] (generic
_handle_irq+0x20/0x30)
[  363.226671] [<c02653e0>] (generic_handle_irq) from [<c021803c>] (handle_IRQ+0
x68/0x90)
[  363.234567] [<c021803c>] (handle_IRQ) from [<c02084e0>] (gic_handle_irq+0x3c/
0x60)
[  363.242120] [<c02084e0>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0
x70)
[  363.249581] Exception stack(0xc085de68 to 0xc085deb0)
[  363.254616] de60:                   00000004 db7e50a0 0000009d 00000000 d8bb8
d18 d8bb8d00
[  363.262777] de80: d8bb8c20 00000002 00000030 00000018 db7e5000 00000006 00000
000 c085deb0
[  363.270935] dea0: bfb68c98 c020cae8 60000113 ffffffff
[  363.275977] [<c02095c0>] (__irq_svc) from [<c020cae8>] (_test_and_clear_bit+0
x0/0x48)
[  363.283850] [<c020cae8>] (_test_and_clear_bit) from [<bfb68c98>] (ieee80211_k
ick_airtime+0x88/0x188 [mac80211])
[  363.293963] [<bfb68c98>] (ieee80211_kick_airtime [mac80211]) from [<c02331ec>
] (tasklet_action+0x8c/0xec)
[  363.303406] [<c02331ec>] (tasklet_action) from [<c02327e4>] (__do_softirq+0x1
04/0x294)

  reply	other threads:[~2018-10-02  7:41 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-16 17:42 [PATCH RFC v4 0/4] Move TXQ scheduling into mac80211 Toke Høiland-Jørgensen
2018-09-16 17:42 ` [PATCH RFC v4 4/4] ath9k: Switch to mac80211 TXQ scheduling and airtime APIs Toke Høiland-Jørgensen
2018-09-16 17:42 ` [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 ` [PATCH RFC v4 2/4] cfg80211: Add airtime statistics and settings Toke Høiland-Jørgensen
2018-09-16 17:42 ` [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                   ` [Make-wifi-fast] " 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 [this message]
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-20 21:29 ` [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

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

  git send-email \
    --in-reply-to=f2b31489b65fc0ce106b45e9938b4794@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 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.