On 2018-09-26 02:22, Toke Høiland-Jørgensen wrote:
Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxx> writes:
On 2018-09-16 10:42, Toke Høiland-Jørgensen wrote:
+ if (ret) {
+ clear_bit(IEEE80211_TXQ_AIRTIME_THROTTLE, &txqi->flags);
+ list_del_init(&txqi->schedule_order);
+ } else
+ set_bit(IEEE80211_TXQ_AIRTIME_THROTTLE, &txqi->flags);
+
This looks wrong to me. txqi->flags are protected by fq->lock but here
it is by active_txq_lock. no?
Both set_bit() and clear_bit() are atomic operations, so they don't
need
separate locking. See Documentation/atomic_bitops.txt
:( Yeah... I got confused with attached soft lockup in ARM platform.
@@ -3677,6 +3751,7 @@ void ieee80211_txq_schedule_end(struct
ieee80211_hw *hw, u8 ac)
struct ieee80211_local *local = hw_to_local(hw);
spin_unlock_bh(&local->active_txq_lock[ac]);
+ tasklet_schedule(&local->wake_txqs_tasklet);
}
It is an overload to schedule wake_txqs_tasklet for each txq unlock.
Instead I would prefer to call __ieee80211_kick_airtime from
schedule_end.
Thoughts?
Yeah, I realise scheduling the whole wake_txqs_tasklet is maybe a bit
heavy-handed here. However just calling into __ieee80211_kick_airtime()
means we'll end up recursing back to the same place, which is not good
either (we could in theory flip-flop between two queues until we run
out
of stack space).
IMHO schedule_start/end is needed for tracking first node to break the
loop.
It is not applicable when the driver calls may_transmit(). It would be
better
if active_txq_lock is moved within may_transmit.
My "backup plan" if the wake_txqs_tasklet turns out to be too heavy was
to define a new tasklet just for this use; but wanted to see if this
actually turned out to be a problem first...
Instead of adding new tasklet, we can introduce new API to iterate
through
throttled txqs. Driver that make use of may_transmit, have to call this
new API
at the end of irq handler i.e after processing tx/rx.
-Rajkumar
BUG: soft lockup - CPU#1 stuck for 22s! [swapper/1:0]
[ 1944.211170] Modules linked in: ath10k_pci ath10k_core ath mac80211 cfg80211 compat iptable_nat nf_nat_pptp nf_nat_ipv4 nf_nat_amanda nf_conntrack_pptp nf_conntrack_ipv6 nf_conntrack_ipv4 nf_conntrack_amanda xt_time xt_tcpudp xt_tcpmss xt_string xt_statistic xt_state xt_recent xt_quota xt_policy xt_pkttype xt_physdev xt_owner xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_addrtype xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_DSCP xt_CT xt_CLASSIFY usbnet ts_kmp ts_fsm ts_bm r8152 pppoe ppp_mppe ppp_async nf_nat_tftp nf_nat_snmp_basic nf_nat_sip nf_nat_rtsp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip nf_conntrack_rtsp nf_conntrack_proto_gre nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_broadcast l2tp_ppp iptable_raw iptable_mangle iptable_filter ipt_ah ipt_REJECT ipt_MASQUERADE ipt_ECN ip_tables crc_ccitt arptable_filter arpt_mangle arp_tables sch_teql sch_tbf sch_sfq sch_red sch_prio sch_pie sch_htb sch_gred sch_fq sch_dsmark sch_codel em_text em_nbyte em_meta em_cmp cls_basic act_police act_ipt act_connmark act_skbedit act_mirred em_u32 cls_u32 cls_tcindex cls_flow cls_route cls_fw sch_hfsc sch_ingress qca_nss_ipsec qca_nss_cfi_ocf qca_nss_tunipip6 qca_nss_tun6rd qca_nss_ipsecmgr qca_nss_cfi_cryptoapi qca_nss_qdisc qca_nss_macsec qca_nss_crypto_tool qca_nss_crypto qca_nss_pptp pptp pppox qca_nss_map_t qca_nss_lag_mgr qca_nss_l2tpv2 ppp_generic slhc qca_nss_gre hyfi_bridging nf_nat_proto_sctp nf_nat libcrc32c ledtrig_usbdev nf_conntrack_proto_sctp essedma ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables qca_mcs qca_85xx_sw msdos bonding ip6_gre ip_gre gre ifb nat46 sit qca_nss_drv l2tp_netlink l2tp_core ipcomp6 xfrm6_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet esp6 ah6 ipcomp xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet esp4 ah4 ip6_tunnel qca_nss_gmac tunnel6 tunnel4 ip_tunnel snd_pcm_oss snd_mixer_oss snd_rawmidi snd_seq_device qca_ssdk af_key xfrm_user xfrm_ipcomp xfrm_algo vfat fat ntfs qrfs nf_conntrack nls_iso8859_1 nls_cp437 shortcut_fe_drv aq_phy shortcut_fe_ipv6 shortcut_fe sha1_generic qcrypto cryptosoft cryptodev ocf md5 hmac ecb des_generic cbc authenc usb_storage leds_gpio bootconfig xhci_hcd dwc3 udc_core dwc3_qcom dwc3_ipq40xx phy_qcom_ssusb phy_qcom_hsusb phy_qca_uniphy phy_qca_baldur sd_mod ahci_platform gpio_button_hotplug button_hotplug input_core usbcore nls_base usb_common mii [last unloaded: ecm]
[ 1944.440683]
[ 1944.442163] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.14.77 #5
[ 1944.448151] task: dd47bf40 ti: dd49c000 task.ti: dd49c000
[ 1944.453541] PC is at _test_and_clear_bit+0xc/0x48
[ 1944.458283] LR is at ieee80211_wake_txqs+0x150/0x434 [mac80211]
[ 1944.464124] pc : [<c020caf4>] lr : [<bfb63ef8>] psr: 60000113
[ 1944.464124] sp : dd49dec0 ip : 00000000 fp : 00000030
[ 1944.475581] r10: d8b58c30 r9 : d63ab000 r8 : d8b58d18
[ 1944.480788] r7 : d8b58d00 r6 : 00000002 r5 : d6650500 r4 : d8b58c20
[ 1944.487299] r3 : 00000000 r2 : 00000001 r1 : d63ab0a0 r0 : 00000004
[ 1944.493811] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 1944.501100] Control: 10c5787d Table: 5801406a DAC: 00000015
[ 1944.506830] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.14.77 #5
[ 1944.512832] [<c021db64>] (unwind_backtrace) from [<c021abf8>] (show_stack+0x10/0x14)
[ 1944.520555] [<c021abf8>] (show_stack) from [<c03c93d4>] (dump_stack+0x80/0xa0)
[ 1944.527761] [<c03c93d4>] (dump_stack) from [<c0285e68>] (watchdog_timer_fn+0x10c/0x160)
[ 1944.535744] [<c0285e68>] (watchdog_timer_fn) from [<c024a64c>] (__run_hrtimer+0x50/0xc8)
[ 1944.543815] [<c024a64c>] (__run_hrtimer) from [<c024ae30>] (hrtimer_interrupt+0x130/0x27c)
[ 1944.552064] [<c024ae30>] (hrtimer_interrupt) from [<c051afa0>] (msm_timer_interrupt+0x38/0x44)
[ 1944.560658] [<c051afa0>] (msm_timer_interrupt) from [<c026c9b8>] (handle_percpu_devid_irq+0x68/0x84)
[ 1944.569774] [<c026c9b8>] (handle_percpu_devid_irq) from [<c026932c>] (generic_handle_irq+0x20/0x30)
[ 1944.578802] [<c026932c>] (generic_handle_irq) from [<c02181dc>] (handle_IRQ+0x68/0x90)
[ 1944.586697] [<c02181dc>] (handle_IRQ) from [<c02084e0>] (gic_handle_irq+0x3c/0x60)
[ 1944.594248] [<c02084e0>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0x70)
[ 1944.601710] Exception stack(0xdd49de78 to 0xdd49dec0)
[ 1944.606744] de60: 00000004 d63ab0a0
[ 1944.614904] de80: 00000001 00000000 d8b58c20 d6650500 00000002 d8b58d00 d8b58d18 d63ab000
[ 1944.623064] dea0: d8b58c30 00000030 00000000 dd49dec0 bfb63ef8 c020caf4 60000113 ffffffff
[ 1944.631229] [<c02095c0>] (__irq_svc) from [<c020caf4>] (_test_and_clear_bit+0xc/0x48)
[ 1944.639066] [<c020caf4>] (_test_and_clear_bit) from [<bfb63ef8>] (ieee80211_wake_txqs+0x150/0x434 [mac80211])
[ 1944.649040] [<bfb63ef8>] (ieee80211_wake_txqs [mac80211]) from [<c0232f88>] (tasklet_action+0x8c/0xec)
[ 1944.658224] [<c0232f88>] (tasklet_action) from [<c0232580>] (__do_softirq+0x104/0x294)
[ 1944.666121] [<c0232580>] (__do_softirq) from [<c02329fc>] (irq_exit+0x9c/0x11c)
[ 1944.673415] [<c02329fc>] (irq_exit) from [<c02181e0>] (handle_IRQ+0x6c/0x90)
[ 1944.680445] [<c02181e0>] (handle_IRQ) from [<c02084e0>] (gic_handle_irq+0x3c/0x60)
[ 1944.687995] [<c02084e0>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0x70)
[ 1944.695458] Exception stack(0xdd49dfa0 to 0xdd49dfe8)
[ 1944.700494] dfa0: ffffffed 00000000 1d3c4000 c020a040 dd49c000 dd49c030 10c0387d c08ba2c8
[ 1944.708656] dfc0: 4220406a 512f04d0 00000000 00000000 00000000 dd49dfe8 c02184a0 c02184a4
[ 1944.716812] dfe0: 60000013 ffffffff
[ 1944.720290] [<c02095c0>] (__irq_svc) from [<c02184a4>] (arch_cpu_idle+0x38/0x5c)
[ 1944.727670] [<c02184a4>] (arch_cpu_idle) from [<c0269298>] (cpu_startup_entry+0xa4/0x108)
[ 1944.735859] [<c0269298>] (cpu_startup_entry) from [<422085a4>] (0x422085a4)
[ 1948.126113] BUG: soft lockup - CPU#0 stuck for 23s! [swapper/0:0]
[ 1948.131163] Modules linked in: ath10k_pci ath10k_core ath mac80211 cfg80211 compat iptable_nat nf_nat_pptp nf_nat_ipv4 nf_nat_amanda nf_conntrack_pptp nf_conntrack_ipv6 nf_conntrack_ipv4 nf_conntrack_amanda xt_time xt_tcpudp xt_tcpmss xt_string xt_statistic xt_state xt_recent xt_quota xt_policy xt_pkttype xt_physdev xt_owner xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_addrtype xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_DSCP xt_CT xt_CLASSIFY usbnet ts_kmp ts_fsm ts_bm r8152 pppoe ppp_mppe ppp_async nf_nat_tftp nf_nat_snmp_basic nf_nat_sip nf_nat_rtsp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip nf_conntrack_rtsp nf_conntrack_proto_gre nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_broadcast l2tp_ppp iptable_raw iptable_mangle iptable_filter ipt_ah ipt_REJECT ipt_MASQUERADE ipt_ECN ip_tables crc_ccitt arptable_filter arpt_mangle arp_tables sch_teql sch_tbf sch_sfq sch_red sch_prio sch_pie sch_htb sch_gred sch_fq sch_dsmark sch_codel em_text em_nbyte em_meta em_cmp cls_basic act_police act_ipt act_connmark act_skbedit act_mirred em_u32 cls_u32 cls_tcindex cls_flow cls_route cls_fw sch_hfsc sch_ingress qca_nss_ipsec qca_nss_cfi_ocf qca_nss_tunipip6 qca_nss_tun6rd qca_nss_ipsecmgr qca_nss_cfi_cryptoapi qca_nss_qdisc qca_nss_macsec qca_nss_crypto_tool qca_nss_crypto qca_nss_pptp pptp pppox qca_nss_map_t qca_nss_lag_mgr qca_nss_l2tpv2 ppp_generic slhc qca_nss_gre hyfi_bridging nf_nat_proto_sctp nf_nat libcrc32c ledtrig_usbdev nf_conntrack_proto_sctp essedma ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables qca_mcs qca_85xx_sw msdos bonding ip6_gre ip_gre gre ifb nat46 sit qca_nss_drv l2tp_netlink l2tp_core ipcomp6 xfrm6_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet esp6 ah6 ipcomp xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet esp4 ah4 ip6_tunnel qca_nss_gmac tunnel6 tunnel4 ip_tunnel snd_pcm_oss snd_mixer_oss snd_rawmidi snd_seq_device qca_ssdk af_key xfrm_user xfrm_ipcomp xfrm_algo vfat fat ntfs qrfs nf_conntrack nls_iso8859_1 nls_cp437 shortcut_fe_drv aq_phy shortcut_fe_ipv6 shortcut_fe sha1_generic qcrypto cryptosoft cryptodev ocf md5 hmac ecb des_generic cbc authenc usb_storage leds_gpio bootconfig xhci_hcd dwc3 udc_core dwc3_qcom dwc3_ipq40xx phy_qcom_ssusb phy_qcom_hsusb phy_qca_uniphy phy_qca_baldur sd_mod ahci_platform gpio_button_hotplug button_hotplug input_core usbcore nls_base usb_common mii [last unloaded: ecm]
[ 1948.360675]
[ 1948.362153] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.77 #5
[ 1948.368143] task: c086e790 ti: c0862000 task.ti: c0862000
[ 1948.373527] PC is at _raw_spin_lock_bh+0x48/0x5c
[ 1948.378152] LR is at ieee80211_tx_dequeue+0x6e8/0x8ec [mac80211]
[ 1948.384115] pc : [<c0212144>] lr : [<bfb5e3c0>] psr: 20000113
[ 1948.384115] sp : c0863c68 ip : d4f4dfa8 fp : d6956000
[ 1948.395573] r10: d8b58cb4 r9 : d8b58ca8 r8 : d8b58cac
[ 1948.400781] r7 : 00000000 r6 : d6d38c00 r5 : d63ab0a4 r4 : d8b58c20
[ 1948.407291] r3 : 00003abd r2 : 00003abe r1 : 00000000 r0 : d8b58d00
[ 1948.413802] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 1948.421093] Control: 10c5787d Table: 5806806a DAC: 00000015
[ 1948.426823] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.77 #5
[ 1948.432819] [<c021db64>] (unwind_backtrace) from [<c021abf8>] (show_stack+0x10/0x14)
[ 1948.440543] [<c021abf8>] (show_stack) from [<c03c93d4>] (dump_stack+0x80/0xa0)
[ 1948.447748] [<c03c93d4>] (dump_stack) from [<c0285e68>] (watchdog_timer_fn+0x10c/0x160)
[ 1948.455733] [<c0285e68>] (watchdog_timer_fn) from [<c024a64c>] (__run_hrtimer+0x50/0xc8)
[ 1948.463805] [<c024a64c>] (__run_hrtimer) from [<c024ae30>] (hrtimer_interrupt+0x130/0x27c)
[ 1948.472053] [<c024ae30>] (hrtimer_interrupt) from [<c051afa0>] (msm_timer_interrupt+0x38/0x44)
[ 1948.480646] [<c051afa0>] (msm_timer_interrupt) from [<c026c9b8>] (handle_percpu_devid_irq+0x68/0x84)
[ 1948.489761] [<c026c9b8>] (handle_percpu_devid_irq) from [<c026932c>] (generic_handle_irq+0x20/0x30)
[ 1948.498790] [<c026932c>] (generic_handle_irq) from [<c02181dc>] (handle_IRQ+0x68/0x90)
[ 1948.506688] [<c02181dc>] (handle_IRQ) from [<c02084e0>] (gic_handle_irq+0x3c/0x60)
[ 1948.514239] [<c02084e0>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0x70)
[ 1948.521701] Exception stack(0xc0863c20 to 0xc0863c68)
[ 1948.526737] 3c20: d8b58d00 00000000 00003abe 00003abd d8b58c20 d63ab0a4 d6d38c00 00000000
[ 1948.534898] 3c40: d8b58cac d8b58ca8 d8b58cb4 d6956000 d4f4dfa8 c0863c68 bfb5e3c0 c0212144
[ 1948.543056] 3c60: 20000113 ffffffff
[ 1948.546531] [<c02095c0>] (__irq_svc) from [<c0212144>] (_raw_spin_lock_bh+0x48/0x5c)
[ 1948.554284] [<c0212144>] (_raw_spin_lock_bh) from [<bfb5e3c0>] (ieee80211_tx_dequeue+0x6e8/0x8ec [mac80211])
[ 1948.564122] [<bfb5e3c0>] (ieee80211_tx_dequeue [mac80211]) from [<bfb606a0>] (__ieee80211_subif_start_xmit+0x7e4/0x870 [mac80211])
[ 1948.575838] [<bfb606a0>] (__ieee80211_subif_start_xmit [mac80211]) from [<bfb60a7c>] (ieee80211_subif_start_xmit+0x104/0x110 [mac80211])
[ 1948.588055] [<bfb60a7c>] (ieee80211_subif_start_xmit [mac80211]) from [<c059f9b0>] (dev_hard_start_xmit+0x320/0x454)
[ 1948.598529] [<c059f9b0>] (dev_hard_start_xmit) from [<c059fe5c>] (__dev_queue_xmit+0x378/0x454)
[ 1948.607212] [<c059fe5c>] (__dev_queue_xmit) from [<c0659850>] (br_dev_queue_push_xmit+0xbc/0xc4)
[ 1948.615979] [<c0659850>] (br_dev_queue_push_xmit) from [<c065ae98>] (br_handle_frame_finish+0x508/0x54c)
[ 1948.625439] [<c065ae98>] (br_handle_frame_finish) from [<c065b1b4>] (br_handle_frame+0x2d8/0x340)
[ 1948.634293] [<c065b1b4>] (br_handle_frame) from [<c059c5e0>] (__netif_receive_skb_core+0x4e0/0x6e0)
[ 1948.643321] [<c059c5e0>] (__netif_receive_skb_core) from [<c059e1d8>] (process_backlog+0x90/0x158)
[ 1948.652262] [<c059e1d8>] (process_backlog) from [<c059db70>] (net_rx_action+0xac/0x160)
[ 1948.660247] [<c059db70>] (net_rx_action) from [<c0232580>] (__do_softirq+0x104/0x294)
[ 1948.668059] [<c0232580>] (__do_softirq) from [<c02329fc>] (irq_exit+0x9c/0x11c)
[ 1948.675352] [<c02329fc>] (irq_exit) from [<c02181e0>] (handle_IRQ+0x6c/0x90)
[ 1948.682381] [<c02181e0>] (handle_IRQ) from [<c02084e0>] (gic_handle_irq+0x3c/0x60)
[ 1948.689933] [<c02084e0>] (gic_handle_irq) from [<c02095c0>] (__irq_svc+0x40/0x70)
[ 1948.697396] Exception stack(0xc0863f60 to 0xc0863fa8)
[ 1948.702432] 3f60: ffffffed 00000000 1d3bc000 c020a040 c0862000 c0862030 ffffffff c08ba014
[ 1948.710592] 3f80: c086a3c0 c0858ba8 ddffcd40 c08ba010 c0873548 c0863fa8 c02184a0 c02184a4
[ 1948.718751] 3fa0: 60000013 ffffffff
[ 1948.722226] [<c02095c0>] (__irq_svc) from [<c02184a4>] (arch_cpu_idle+0x38/0x5c)
[ 1948.729608] [<c02184a4>] (arch_cpu_idle) from [<c0269298>] (cpu_startup_entry+0xa4/0x108)
[ 1948.737766] [<c0269298>] (cpu_startup_entry) from [<c0837af0>] (start_kernel+0x358/0x3cc)