* [PATCH rh6] mm: skip zombie in OOM-killer
@ 2011-03-04 21:30 Andrey Vagin
2011-03-04 23:41 ` David Rientjes
2011-03-08 1:25 ` KOSAKI Motohiro
0 siblings, 2 replies; 5+ messages in thread
From: Andrey Vagin @ 2011-03-04 21:30 UTC (permalink / raw)
To: Andrew Morton
Cc: David Rientjes, KOSAKI Motohiro, avagin, linux-mm, linux-kernel
A parent may wait a memory and zombie will prevent killing another task.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
mm/oom_kill.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 7dcca55..2fc554e 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -311,7 +311,7 @@ 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) && p->mm)
return ERR_PTR(-1UL);
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH rh6] mm: skip zombie in OOM-killer
2011-03-04 21:30 [PATCH rh6] mm: skip zombie in OOM-killer Andrey Vagin
@ 2011-03-04 23:41 ` David Rientjes
2011-03-05 0:52 ` avagin
2011-03-06 11:20 ` KOSAKI Motohiro
2011-03-08 1:25 ` KOSAKI Motohiro
1 sibling, 2 replies; 5+ messages in thread
From: David Rientjes @ 2011-03-04 23:41 UTC (permalink / raw)
To: Andrey Vagin; +Cc: Andrew Morton, KOSAKI Motohiro, linux-mm, linux-kernel
On Sat, 5 Mar 2011, Andrey Vagin wrote:
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index 7dcca55..2fc554e 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -311,7 +311,7 @@ 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) && p->mm)
> return ERR_PTR(-1UL);
>
> /*
I think it would be better to just do
if (!p->mm)
continue;
after the check for oom_unkillable_task() because everything that follows
this really depends on p->mm being non-NULL to actually do anything
useful.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH rh6] mm: skip zombie in OOM-killer
2011-03-04 23:41 ` David Rientjes
@ 2011-03-05 0:52 ` avagin
2011-03-06 11:20 ` KOSAKI Motohiro
1 sibling, 0 replies; 5+ messages in thread
From: avagin @ 2011-03-05 0:52 UTC (permalink / raw)
To: David Rientjes
Cc: Andrey Vagin, Andrew Morton, KOSAKI Motohiro, linux-mm,
linux-kernel
On 03/05/2011 02:41 AM, David Rientjes wrote:
> On Sat, 5 Mar 2011, Andrey Vagin wrote:
>
>> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
>> index 7dcca55..2fc554e 100644
>> --- a/mm/oom_kill.c
>> +++ b/mm/oom_kill.c
>> @@ -311,7 +311,7 @@ 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)&& p->mm)
>> return ERR_PTR(-1UL);
>>
>> /*
>
> I think it would be better to just do
>
> if (!p->mm)
> continue;
>
> after the check for oom_unkillable_task() because everything that follows
> this really depends on p->mm being non-NULL to actually do anything
> useful.
Yes. You are right. Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH rh6] mm: skip zombie in OOM-killer
2011-03-04 23:41 ` David Rientjes
2011-03-05 0:52 ` avagin
@ 2011-03-06 11:20 ` KOSAKI Motohiro
1 sibling, 0 replies; 5+ messages in thread
From: KOSAKI Motohiro @ 2011-03-06 11:20 UTC (permalink / raw)
To: David Rientjes
Cc: kosaki.motohiro, Andrey Vagin, Andrew Morton, linux-mm,
linux-kernel
> On Sat, 5 Mar 2011, Andrey Vagin wrote:
>
> > diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> > index 7dcca55..2fc554e 100644
> > --- a/mm/oom_kill.c
> > +++ b/mm/oom_kill.c
> > @@ -311,7 +311,7 @@ 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) && p->mm)
> > return ERR_PTR(-1UL);
> >
> > /*
>
> I think it would be better to just do
>
> if (!p->mm)
> continue;
>
> after the check for oom_unkillable_task() because everything that follows
> this really depends on p->mm being non-NULL to actually do anything
> useful.
I'm glad you join to review MM patches. It is worth effort for making
solid kernel. But, please look at a current code at first.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH rh6] mm: skip zombie in OOM-killer
2011-03-04 21:30 [PATCH rh6] mm: skip zombie in OOM-killer Andrey Vagin
2011-03-04 23:41 ` David Rientjes
@ 2011-03-08 1:25 ` KOSAKI Motohiro
1 sibling, 0 replies; 5+ messages in thread
From: KOSAKI Motohiro @ 2011-03-08 1:25 UTC (permalink / raw)
To: Andrey Vagin
Cc: kosaki.motohiro, Andrew Morton, David Rientjes, linux-mm,
linux-kernel
> A parent may wait a memory and zombie will prevent killing another task.
>
> Signed-off-by: Andrey Vagin <avagin@openvz.org>
> ---
> mm/oom_kill.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index 7dcca55..2fc554e 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -311,7 +311,7 @@ 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) && p->mm)
> return ERR_PTR(-1UL);
OK. Good catch.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-08 1:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 21:30 [PATCH rh6] mm: skip zombie in OOM-killer Andrey Vagin
2011-03-04 23:41 ` David Rientjes
2011-03-05 0:52 ` avagin
2011-03-06 11:20 ` KOSAKI Motohiro
2011-03-08 1:25 ` KOSAKI Motohiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).