Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
description of repo status
Open Source
>
Other
>
Operation System
&&
Watch
Unwatch
Watching
Releases Only
Ignoring
456
Star
1.7K
Fork
1.9K
GVP
openEuler
/
kernel
Closed
Code
Issues
1271
Pull Requests
981
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
[OLK-5.10] raw socket全局rwlock转换成rcu以解决softlockup问题
Done
#I6ECEK
Task
user_9799116
Opened this issue
2023-02-10 20:17
问题简介: 使用类似如下命令在多cpu平台下会触发softlockup问题: #!/bin/bash for i in {0..25}; do cpu=$(printf $((`expr $i % 26`))) taskset -c $cpu ping -4 -fq 127.0.0.1 & sleep 0.1 done sleep 1 for i in {1..100}; do ping -4 -c 1 127.0.0.1 sleep 1; done 问题根因: raw中有使用全局读写锁rwlock,IO接收中获取读锁,raw socket创建中获取写锁。IO接收流程在中断上下文中,读写锁在 70af2f8a4f48 ("locking/rwlocks: Introduce 'qrwlocks' - fair, queued rwlocks") v3.16 后是不公平的:读锁在中断上下文中会优先获取锁。当在多并发大压力的raw收包场景下,读锁一直被优先获取,创建raw socket流程的获取写锁流程中一直while等待读锁释放,长时间等不到就会触发softlockup。 修改方法: 将全局读写锁rwlock转变成rcu锁机制,主线6.0版本已合入,相关commit如下: 76dd07281338 Fix crash when IPv6 is administratively disabled c4fceb46add6 raw: remove unused variables from raw6_icmp_error() 97a4d46b1516 raw: fix a typo in raw_icmp_error() af185d8c7633 raw: complete rcu conversion f289c02bf41b raw: Use helpers for the hlist_nulls variant. 5da39e31b1b0 raw: Fix mixed declarations error in raw_icmp_error(). 0daf07e52709 raw: convert raw sockets to RCU ba44f8182ec2 raw: use more conventional iterators
问题简介: 使用类似如下命令在多cpu平台下会触发softlockup问题: #!/bin/bash for i in {0..25}; do cpu=$(printf $((`expr $i % 26`))) taskset -c $cpu ping -4 -fq 127.0.0.1 & sleep 0.1 done sleep 1 for i in {1..100}; do ping -4 -c 1 127.0.0.1 sleep 1; done 问题根因: raw中有使用全局读写锁rwlock,IO接收中获取读锁,raw socket创建中获取写锁。IO接收流程在中断上下文中,读写锁在 70af2f8a4f48 ("locking/rwlocks: Introduce 'qrwlocks' - fair, queued rwlocks") v3.16 后是不公平的:读锁在中断上下文中会优先获取锁。当在多并发大压力的raw收包场景下,读锁一直被优先获取,创建raw socket流程的获取写锁流程中一直while等待读锁释放,长时间等不到就会触发softlockup。 修改方法: 将全局读写锁rwlock转变成rcu锁机制,主线6.0版本已合入,相关commit如下: 76dd07281338 Fix crash when IPv6 is administratively disabled c4fceb46add6 raw: remove unused variables from raw6_icmp_error() 97a4d46b1516 raw: fix a typo in raw_icmp_error() af185d8c7633 raw: complete rcu conversion f289c02bf41b raw: Use helpers for the hlist_nulls variant. 5da39e31b1b0 raw: Fix mixed declarations error in raw_icmp_error(). 0daf07e52709 raw: convert raw sockets to RCU ba44f8182ec2 raw: use more conventional iterators
Comments (
2
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Declined
Assignees
Not set
Labels
sig/Kernel
Not set
Projects
Unprojected
Unprojected
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
Duration
(hours)
参与者(3)
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register