mm: oom: do not reap task if there are live threads in threadgroup
Subsystems (2)
PATCH 1/1 mm: oom: do not reap task if there are live threads in threadgroup
If the current process is exiting, we don't invoke oom killer, instead we give it access to memory reserves and try to reap its mm in case nobody is going to use it. There's a mistake in the code performing this check - we just ignore any process of the same thread group no matter if it is exiting or not - see try_oom_reaper. Fix it.
--- mm/oom_kill.c | 2 -- 1 file changed, 2 deletions(-)
mm/oom_kill.c +0 -2
@@ -618,8 +618,6 @@ void try_oom_reaper(struct task_struct *tsk)if (!process_shares_mm (p, mm))continue ; -if (same_thread_group (p, tsk)) -continue ;if (fatal_signal_pending (p))continue ;
Signature · 1 line
2.1.4
Quoted 5 lines · Vladimir Davydov
If the current process is exiting, we don't invoke oom killer, instead we give it access to memory reserves and try to reap its mm in case nobody is going to use it. There's a mistake in the code performing this check - we just ignore any process of the same thread group no matter if it is exiting or not - see
try_oom_reaper. Fix it.
This is not a problem with the current code because of 98748bd72200 ("oom: consider multi-threaded tasks in task_will_free_mem") which got merged later on, however.
The check is not needed so we can indeed drop it.
regular OOM killer path")
Just in case somebody wants to backport only 3ef22dfff239.
Quoted 1 line
Signed-off-by Vladimir Davydov <[email protected]>
Thanks!
Quoted 19 lines
--- mm/oom_kill.c | 2 -- 1 file changed, 2 deletions(-)mm/oom_kill.c +0
-2@@ -618,8 +618,6 @@ void try_oom_reaper(struct task_struct *tsk)if (!process_shares_mm (p, mm))continue ; -if (same_thread_group (p, tsk)) -continue ;if (fatal_signal_pending (p))continue ;Signature · 1 line
2.1.4
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 10 lines · Michal Hocko
Quoted 5 lines · Vladimir Davydov
If the current process is exiting, we don't invoke oom killer, instead we give it access to memory reserves and try to reap its mm in case nobody is going to use it. There's a mistake in the code performing this check - we just ignore any process of the same thread group no matter if it is exiting or not - see
try_oom_reaper. Fix it.This is not a problem with the current code because of
98748bd72200("oom: consider multi-threaded tasks intask_will_free_mem") which got merged later on, however.
True, I missed that patch.
Quoted 11 lines
The check is not needed so we can indeed drop it.
Fixes 3ef22dfff239 ("oom, oom_reaper: try to reap tasks which skipregular OOM killer path")
Just in case somebody wants to backport only
3ef22dfff239.Quoted 1 line
Signed-off-by Vladimir Davydov <[email protected]>Acked-by Michal Hocko <[email protected]>
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>