mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
oom: thaw threads if oom killed thread is frozen before deferring
If a thread has been oom killed and is frozen, thaw it before returning to the page allocator. Otherwise, it can stay frozen indefinitely and no memory will be freed. Signed-off-by: David Rientjes <[email protected]> Reported-by: Konstantin Khlebnikov <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
d08c429b06
commit
f660daac47
1 file changed
+5
-1
+5
-1
@@ -32,6 +32,7 @@
|
||||
#include <linux/mempolicy.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
int sysctl_panic_on_oom;
|
||||
int sysctl_oom_kill_allocating_task;
|
||||
@@ -317,8 +318,11 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
|
||||
* blocked waiting for another task which itself is waiting
|
||||
* for memory. Is there a better alternative?
|
||||
*/
|
||||
if (test_tsk_thread_flag(p, TIF_MEMDIE))
|
||||
if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
|
||||
if (unlikely(frozen(p)))
|
||||
thaw_process(p);
|
||||
return ERR_PTR(-1UL);
|
||||
}
|
||||
if (!p->mm)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in new issue
Block a user