Skip to content

Commit a34c80a

Browse files
Michal Hockotorvalds
Michal Hocko
authored andcommittedJul 28, 2016
freezer, oom: check TIF_MEMDIE on the correct task
freezing_slow_path() is checking TIF_MEMDIE to skip OOM killed tasks. It is, however, checking the flag on the current task rather than the given one. This is really confusing because freezing() can be called also on !current tasks. It would end up working correctly for its main purpose because __refrigerator will be always called on the current task so the oom victim will never get frozen. But it could lead to surprising results when a task which is freezing a cgroup got oom killed because only part of the cgroup would get frozen. This is highly unlikely but worth fixing as the resulting code would be more clear anyway. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Michal Hocko <[email protected]> Cc: David Rientjes <[email protected]> Cc: Miao Xie <[email protected]> Cc: Miao Xie <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b2b331f commit a34c80a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎kernel/freezer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bool freezing_slow_path(struct task_struct *p)
4242
if (p->flags & (PF_NOFREEZE | PF_SUSPEND_TASK))
4343
return false;
4444

45-
if (test_thread_flag(TIF_MEMDIE))
45+
if (test_tsk_thread_flag(p, TIF_MEMDIE))
4646
return false;
4747

4848
if (pm_nosig_freezing || cgroup_freezing(p))

0 commit comments

Comments
 (0)
Please sign in to comment.