399 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

sharepool: 修复潜在的ABBA死锁

已完成
任务
创建于  
2022-04-25 10:52

构造场景令维测打印/proc/sharepool/proc_stat和加入新组并发,可以发现如下ABBA死锁。

There is a ABBA deadlock in the process of sp_group_add_task and
proc_stat_show().

PROCESS A:
sp_group_add_task() acquire sp_group_sem write lock
->sp_init_proc_stat() acquire sp_spg_stat_sem write lock
PROCESS B:
proc_stat_show() acquire sp_spg_stat_sem read lock
->idr_proc_stat_cb() acquire sp_group_sem read lock

Here we choose the simplest way that acquires sp_group_sem and
sp_stat_sem read lock subsequently in proc_stat_show(), since it just
has effect on the process of debug feature.

测试步骤:

  1. 令N个进程并发地加入new group,同时cat /proc/sharepool/proc_stat尝试打印维测信息

测试现象:
出现死锁

评论 (2)

郭梦琪 创建了任务

Hi guo-mengqi, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @pi3orama , @成坚 (CHENG Jian) , @jiaoff , @Qiuuuuu , @zhengzengkai , @刘勇强 , @Xie XiuQi

openeuler-ci-bot 添加了
 
sig/Kernel
标签
郭梦琪 修改了描述
zhengzengkai 关联分支设置为OLK-5.10
zhengzengkai 关联分支OLK-5.10 修改为openEuler-1.0-LTS

受影响版本排查(受影响/不受影响):
1.openEuler-22.03-LTS(5.10.0):受影响
2.openEuler-20.03-LTS-SP1(4.19.90):受影响
3.openEuler-20.03-LTS-SP2(4.19.90):受影响
4.openEuler-20.03-LTS-SP3(4.19.194):受影响

修复是否涉及abi变化(是/否):
1.openEuler-22.03-LTS(5.10.0):否
2.openEuler-20.03-LTS-SP1(4.19.90):否
3.openEuler-20.03-LTS-SP2(4.19.90):否
4.openEuler-20.03-LTS-SP3(4.19.194):否

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助