Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    rtl8723ds高并发时死锁有人遇到过吗

    A Series
    1
    3
    2127
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mengxp LV 5 last edited by mengxp

      目前在r328平台上使用rtl8723ds高并发流量时内核死锁
      具体表现是 top 监控到 RTWHALXT 内核线程占用 CPU 50% (r328其中一个核心)
      随后系统死掉,shell会弹出提示
      [ 274.772512] INFO: rcu_sched self-detected stall on CPU
      [ 274.778301] 1-...: (1 GPs behind) idle=6cb/140000000000001/0 softirq=2804/2805 fqs=7499
      [ 274.787477] (t=15000 jiffies g=1214 c=1213 q=179)
      [ 295.912599] INFO: rcu_sched detected expedited stalls on CPUs/tasks: { 1-... } 15329 jiffies s: 1 root: 0x2/.
      [ 295.923762] blocking rcu_node structures:
      只弹出这些,没有列出更多内容。
      shell不再响应,系统呈现内核死锁状态。

      尝试过使用不同版本的rtl8723ds驱动
      1.R328 SDK中的 v5.6.5_31752.20181221_COEX20181130-2e2e
      2.R329 SDK中的 v5.10.1-26-ga10bc0b8b.20200617_COEX20200103-3535
      3.rtl8723DS_WiFi_linux_v5.13.5-29-g0dbf6713f.20210604_COEX20210106-3b3b.tar.gz https://whycan.com/t_7504.html 这里下载到的

      使用这些驱动都存在上述问题。由于是死锁问题,我尝试关闭一个CPU核心
      echo 0 > /sys/devices/system/cpu/cpu1/online

      这样关闭核心后再测试就不再死锁了。但是这不是个长久之计啊,
      请问有人遇到过这个问题吗?该如何解决??

      补充上述的top图
      RTWHALTX.png

      M 1 Reply Last reply Reply Quote Share 0
      • M
        mengxp LV 5 @mengxp last edited by

        已初步确定是螃蟹的AP模式逻辑问题,并非死锁。

        测试环境
        1.rtl8723ds (AP) <-----> iphone (STA)

        触发条件
        1.作为AP模式
        2.正在发送数据
        3.对方STA进入SLEEP模式,有概率触发该bug。

        问题描述
        1.hal\rtl8723d\sdio\rtl8723ds_xmit.c 中 xmit_xmitframes 函数
        #ifdef CONFIG_AP_MODE
        if (MLME_IS_AP(padapter) || MLME_IS_MESH(padapter)) {
        if ((pxmitframe->attrib.psta->state & WIFI_SLEEP_STATE) &&
        (pxmitframe->attrib.triggered == 0)) {
        RTW_INFO("%s: one not triggered pkt in queue when this STA sleep, break and goto next sta\n", func);
        break;
        }
        }
        #endif

        这段代码意图其实是符合 80211 中的传统省电模式 (Legacy Power Save)

        传统省电模式 (Legacy Power Save)
        假设某个时间STA进入sleep,它通过发送数据帧或null-date帧来告诉AP我进入省电了
        AP收到这个帧后就不发数据帧给处于省电模式下的STA了。
        STA会在下一个 DITM period wake up,并收到AP的beacon
        在beacon 中DTIM 信息元素会告诉 STA,你sleep的时候有发你的数据,我替你存下了,快来取

        但实际工作的时候不知道为什么驱动会反复的触发发送信号量,然后反复的进入这个流程,导致 RTWHALXT 线程占满CPU。
        而且影响到了正常的收发逻辑。

        暂时解决方案
        注释掉上述 break; 语句,逻辑变更为,即使 STA 进入休眠仍然发送,STA收不到就收不到,该帧就算丢弃了。
        实验发现也并没有造成多大的通讯延迟影响。

        后续解决方案
        联系模块fae尝试解决。但我不认为模块fae方面有能力解决这个问题。(我是普通用户不是VIP)

        M 1 Reply Last reply Reply Quote Share 1
        • M
          mengxp LV 5 @mengxp last edited by

          补充测试代码
          https://blog.csdn.net/MengXP/article/details/122736176?spm=1001.2014.3001.5501

          1 Reply Last reply Reply Quote Share 0
          • 1 / 1
          • First post
            Last post

          Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

          行为准则 | 用户协议 | 隐私权政策