402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

【Backport】mm: memcontrol: fix potential oom_lock recursion deadlock

已完成
任务
创建于  
2023-01-13 11:08

主线补丁68aaee147e597b495622b7c9038e5922c7c61f57("mm: memcontrol: fix potential oom_lock recursion deadlock")回合
内存申请失败oom流程中,获取了oom_lock锁之后,调用mem_cgroup_print_oom_meminfo,该函数调用memory_stat_format使用kmalloc申请了内存,此时如果申请失败,触发oom,会导致再次尝试获取oom_lock使得OOM killer失败,此时会触发一个活锁(livelock)状态。此外文件系统中申请内存使用GFP_KERNEL,可能导致死锁。因为oom过程中(持有oom_lock)调用kmalloc,kmalloc调用了fs_reclaim_acquire。文件系统持有fs_reclaim_acquire时发生内存申请失败,会导致死锁。
本质问题均为OOM处理过程中,mem_cgroup_print_oom_meminfo使用kmalloc GFP_KERNEL申请了内存。
该补丁使用static数组来存放数据,避免内存申请的过程。
冲突为修改代码一些上下文与主线不同,有一点比较关键,mem_cgroup_print_oom_meminfo中调用了mem_cgroup_print_memfs_info这个函数,为自研代码,也存在使用kmalloc申请,新增自研补丁修复。

评论 (1)

Cai Xinchen 创建了任务

Hi airsola0711, 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 , @成坚 (CHENG Jian) , @jiaoff , @zhengzengkai , @刘勇强 , @wangxiongfeng , @朱科潜 , @WangShaoBo , @lujialin , @wuxu_buque , @Xu Kuohai , @冷嘲啊 , @Lingmingqiang , @yuzenghui , @juntian , @OSSIM , @陈结松 , @whoisxxx , @koulihong , @刘恺 , @hanjun-guo , @woqidaideshi , @Chiqijun , @Kefeng , @ThunderTown , @AlexGuo , @kylin-mayukun , @Zheng Zucheng , @柳歆 , @Jackie Liu , @zhujianwei001 , @郑振鹏 , @SuperSix173 , @colyli , @Zhang Yi , @htforge , @Qiuuuuu , @Yuehaibing , @xiehaocheng , @guzitao , @CTC-Xibo.Wang , @zhanghongchen , @chen wei , @Jason Zeng , @苟浩 , @DuanqiangWen , @georgeguo , @毛泓博 , @AllenShi , @Xie XiuQi

openeuler-ci-bot 添加了
 
sig/Kernel
标签
Cai Xinchen 修改了描述
Cai Xinchen 修改了描述
zhangjialin 通过openeuler/kernel Pull Request !386任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
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

搜索帮助