Commit cdad681c authored by Ma Wupeng's avatar Ma Wupeng Committed by Zheng Zengkai
Browse files

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: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarNanyong Sun <sunnanyong@huawei.com>
Reviewed-by: default avatarchenhui 00515652 <judy.chenhui@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent e3bd8c4b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -679,6 +679,10 @@ struct wake_q_node {
struct task_struct_resvd {
	/* pointer back to the main task_struct */
	struct task_struct	*task;

#ifdef CONFIG_MMU
	struct timer_list	oom_reaper_timer;
#endif
};

struct task_struct {
@@ -1358,7 +1362,6 @@ struct task_struct {
	int				pagefault_disabled;
#ifdef CONFIG_MMU
	struct task_struct		*oom_reaper_list;
	struct timer_list		oom_reaper_timer;
#endif
#ifdef CONFIG_VMAP_STACK
	struct vm_struct		*stack_vm_area;
+6 −5
Original line number Diff line number Diff line
@@ -706,8 +706,9 @@ static int oom_reaper(void *unused)

static void wake_oom_reaper(struct timer_list *timer)
{
	struct task_struct *tsk = container_of(timer, struct task_struct,
			oom_reaper_timer);
	struct task_struct_resvd *tsk_resvd = container_of(timer,
			struct task_struct_resvd, oom_reaper_timer);
	struct task_struct *tsk = tsk_resvd->task;
	struct mm_struct *mm = tsk->signal->oom_mm;
	unsigned long flags;

@@ -741,9 +742,9 @@ static void queue_oom_reaper(struct task_struct *tsk)
		return;

	get_task_struct(tsk);
	timer_setup(&tsk->oom_reaper_timer, wake_oom_reaper, 0);
	tsk->oom_reaper_timer.expires = jiffies + OOM_REAPER_DELAY;
	add_timer(&tsk->oom_reaper_timer);
	timer_setup(&tsk->_resvd->oom_reaper_timer, wake_oom_reaper, 0);
	tsk->_resvd->oom_reaper_timer.expires = jiffies + OOM_REAPER_DELAY;
	add_timer(&tsk->_resvd->oom_reaper_timer);
}

static int __init oom_init(void)