提交 be378502 编写于 作者: M Ma Wupeng 提交者: Zheng Zengkai

mm: oom_kill: fix KABI broken by "oom_kill.c: futex: delay the OOM reaper to...

mm: oom_kill: fix KABI broken by "oom_kill.c: futex: delay the OOM reaper to allow time for proper futex cleanup"

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I61FDP
CVE: NA

-------------------------------

Move oom_reaper_timer from task_struct to task_struct_resvd to fix KABI
broken.
Signed-off-by: NMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: NNanyong Sun <sunnanyong@huawei.com>
Reviewed-by: Nchenhui <judy.chenhui@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 7c104716
...@@ -675,6 +675,10 @@ struct wake_q_node { ...@@ -675,6 +675,10 @@ struct wake_q_node {
struct task_struct_resvd { struct task_struct_resvd {
/* pointer back to the main task_struct */ /* pointer back to the main task_struct */
struct task_struct *task; struct task_struct *task;
#ifdef CONFIG_MMU
struct timer_list oom_reaper_timer;
#endif
}; };
struct task_struct { struct task_struct {
...@@ -1353,7 +1357,6 @@ struct task_struct { ...@@ -1353,7 +1357,6 @@ struct task_struct {
int pagefault_disabled; int pagefault_disabled;
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
struct task_struct *oom_reaper_list; struct task_struct *oom_reaper_list;
struct timer_list oom_reaper_timer;
#endif #endif
#ifdef CONFIG_VMAP_STACK #ifdef CONFIG_VMAP_STACK
struct vm_struct *stack_vm_area; struct vm_struct *stack_vm_area;
......
...@@ -706,8 +706,9 @@ static int oom_reaper(void *unused) ...@@ -706,8 +706,9 @@ static int oom_reaper(void *unused)
static void wake_oom_reaper(struct timer_list *timer) static void wake_oom_reaper(struct timer_list *timer)
{ {
struct task_struct *tsk = container_of(timer, struct task_struct, struct task_struct_resvd *tsk_resvd = container_of(timer,
oom_reaper_timer); struct task_struct_resvd, oom_reaper_timer);
struct task_struct *tsk = tsk_resvd->task;
struct mm_struct *mm = tsk->signal->oom_mm; struct mm_struct *mm = tsk->signal->oom_mm;
unsigned long flags; unsigned long flags;
...@@ -741,9 +742,9 @@ static void queue_oom_reaper(struct task_struct *tsk) ...@@ -741,9 +742,9 @@ static void queue_oom_reaper(struct task_struct *tsk)
return; return;
get_task_struct(tsk); get_task_struct(tsk);
timer_setup(&tsk->oom_reaper_timer, wake_oom_reaper, 0); timer_setup(&tsk->_resvd->oom_reaper_timer, wake_oom_reaper, 0);
tsk->oom_reaper_timer.expires = jiffies + OOM_REAPER_DELAY; tsk->_resvd->oom_reaper_timer.expires = jiffies + OOM_REAPER_DELAY;
add_timer(&tsk->oom_reaper_timer); add_timer(&tsk->_resvd->oom_reaper_timer);
} }
static int __init oom_init(void) static int __init oom_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册