Commit 85cfe67f authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
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: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9HSOM


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>
parent 5438ea14
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -629,6 +629,9 @@ struct task_struct_resvd {
	 */
	struct task_struct	*task;

#ifdef CONFIG_MMU
	struct timer_list	oom_reaper_timer;
#endif
#ifdef CONFIG_QOS_SCHED_SMART_GRID
	struct sched_grid_qos	*grid_qos;
#endif
@@ -1236,7 +1239,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
@@ -744,8 +744,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;

@@ -779,9 +780,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)