OOM killer is a mechanism that selects and kills processes when the system runs out of memory to reclaim resources and keep the system stable. However, the oom victim cannot terminate on its own when it is frozen, because __thaw_task() only thaws one thread of the victim, while the other threads remain in the frozen state. This change will thaw the entire victim process when OOM occurs, ensuring that the oom victim can terminate on its own. Signed-off-by: zhongjinji --- mm/oom_kill.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 25923cfec9c6..ffa50a1f0132 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -772,12 +772,11 @@ static void mark_oom_victim(struct task_struct *tsk) mmgrab(tsk->signal->oom_mm); /* - * Make sure that the task is woken up from uninterruptible sleep + * Make sure that the process is woken up from uninterruptible sleep * if it is frozen because OOM killer wouldn't be able to free - * any memory and livelock. freezing_slow_path will tell the freezer - * that TIF_MEMDIE tasks should be ignored. + * any memory and livelock. */ - __thaw_task(tsk); + thaw_oom_process(tsk); atomic_inc(&oom_victims); cred = get_task_cred(tsk); trace_mark_victim(tsk, cred->uid.val); -- 2.17.1