Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406066 > unrolled thread

[PATCH] mm: oom: do not reap task if there are live threads in threadgroup

Started byVladimir Davydov <vdavydov@virtuozzo.com>
First post2016-05-24 13:10 +0200
Last post2016-05-24 14:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm: oom: do not reap task if there are live threads in threadgroup Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-05-24 13:10 +0200
    Re: [PATCH] mm: oom: do not reap task if there are live threads in  threadgroup Michal Hocko <mhocko@kernel.org> - 2016-05-24 13:50 +0200
      Re: [PATCH] mm: oom: do not reap task if there are live threads in  threadgroup Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-05-24 14:30 +0200

#1406066 — [PATCH] mm: oom: do not reap task if there are live threads in threadgroup

FromVladimir Davydov <vdavydov@virtuozzo.com>
Date2016-05-24 13:10 +0200
Subject[PATCH] mm: oom: do not reap task if there are live threads in threadgroup
Message-ID<rCinL-2ur-17@gated-at.bofh.it>
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.

Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
---
 mm/oom_kill.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index c0e37dd1422f..03bf7a472296 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -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;
 
-- 
2.1.4

[toc] | [next] | [standalone]


#1406095 — Re: [PATCH] mm: oom: do not reap task if there are live threads in threadgroup

FromMichal Hocko <mhocko@kernel.org>
Date2016-05-24 13:50 +0200
SubjectRe: [PATCH] mm: oom: do not reap task if there are live threads in threadgroup
Message-ID<rCj0u-2KE-13@gated-at.bofh.it>
In reply to#1406066
On Tue 24-05-16 14:00:28, Vladimir Davydov wrote:
> 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.

Fixes: 3ef22dfff239 ("oom, oom_reaper: try to reap tasks which skip
regular OOM killer path")

Just in case somebody wants to backport only 3ef22dfff239.

> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>

Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

> ---
>  mm/oom_kill.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index c0e37dd1422f..03bf7a472296 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -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;
>  
> -- 
> 2.1.4

-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1406114 — Re: [PATCH] mm: oom: do not reap task if there are live threads in threadgroup

FromVladimir Davydov <vdavydov@virtuozzo.com>
Date2016-05-24 14:30 +0200
SubjectRe: [PATCH] mm: oom: do not reap task if there are live threads in threadgroup
Message-ID<rCjDc-3cK-15@gated-at.bofh.it>
In reply to#1406095
On Tue, May 24, 2016 at 01:46:12PM +0200, Michal Hocko wrote:
> On Tue 24-05-16 14:00:28, Vladimir Davydov wrote:
> > 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.

True, I missed that patch.

> 
> The check is not needed so we can indeed drop it.
> 
> Fixes: 3ef22dfff239 ("oom, oom_reaper: try to reap tasks which skip
> regular OOM killer path")
> 
> Just in case somebody wants to backport only 3ef22dfff239.
> 
> > Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
> 
> Acked-by: Michal Hocko <mhocko@suse.com>

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web