linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Enable OOM when moving processes between cgroups?
@ 2011-08-31 17:32 Viktor Rosendahl
  2011-08-31 17:54 ` Johannes Weiner
  0 siblings, 1 reply; 5+ messages in thread
From: Viktor Rosendahl @ 2011-08-31 17:32 UTC (permalink / raw)
  To: linux-mm
  Cc: Daisuke Nishimura, KAMEZAWA Hiroyuki, Johannes Weiner,
	Michal Hocko

Hello,

I wonder if there is a specific reason why the  OOM killer hasn't been enabled
in the mem_cgroup_do_precharge() function in mm/memcontrol.c ?

In my testing (2.6.32 kernel with some backported cgroups patches), it improves
the case when there isn't room for the task in the target cgroup.

Signed-off-by: Viktor Rosendahl <viktor.rosendahl@nokia.com>
---
 mm/memcontrol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ebd1e86..9a38b80 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5176,7 +5176,7 @@ one_by_one:
 			batch_count = PRECHARGE_COUNT_AT_ONCE;
 			cond_resched();
 		}
-		ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, 1, &mem, false);
+		ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, 1, &mem, true);
 		if (ret || !mem)
 			/* mem_cgroup_clear_mc() will do uncharge later */
 			return -ENOMEM;
-- 
1.7.5.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Enable OOM when moving processes between cgroups?
  2011-08-31 17:32 [PATCH] Enable OOM when moving processes between cgroups? Viktor Rosendahl
@ 2011-08-31 17:54 ` Johannes Weiner
  2011-09-01  0:02   ` KAMEZAWA Hiroyuki
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johannes Weiner @ 2011-08-31 17:54 UTC (permalink / raw)
  To: Viktor Rosendahl
  Cc: linux-mm, Daisuke Nishimura, KAMEZAWA Hiroyuki, Michal Hocko

On Wed, Aug 31, 2011 at 08:32:21PM +0300, Viktor Rosendahl wrote:
> Hello,
> 
> I wonder if there is a specific reason why the  OOM killer hasn't been enabled
> in the mem_cgroup_do_precharge() function in mm/memcontrol.c ?
> 
> In my testing (2.6.32 kernel with some backported cgroups patches), it improves
> the case when there isn't room for the task in the target cgroup.

Tasks are moved directly on behalf of a request from userspace.  We
would much prefer denying that single request than invoking the
oom-killer on the whole group.

Quite a lot changed in the trycharge-reclaim-retry path since 2009.
Nowadays, charging is retried as long as reclaim is making any
progress at all, so I don't see that it would give up moving a task
too lightly, even without the extra OOM looping.

Is there any chance you could retry with a more recent kernel?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Enable OOM when moving processes between cgroups?
  2011-08-31 17:54 ` Johannes Weiner
@ 2011-09-01  0:02   ` KAMEZAWA Hiroyuki
  2011-09-01  0:13   ` Daisuke Nishimura
  2011-09-02 11:34   ` Viktor Rosendahl
  2 siblings, 0 replies; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-09-01  0:02 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Viktor Rosendahl, linux-mm, Daisuke Nishimura, Michal Hocko

On Wed, 31 Aug 2011 19:54:22 +0200
Johannes Weiner <jweiner@redhat.com> wrote:

> On Wed, Aug 31, 2011 at 08:32:21PM +0300, Viktor Rosendahl wrote:
> > Hello,
> > 
> > I wonder if there is a specific reason why the  OOM killer hasn't been enabled
> > in the mem_cgroup_do_precharge() function in mm/memcontrol.c ?
> > 
> > In my testing (2.6.32 kernel with some backported cgroups patches), it improves
> > the case when there isn't room for the task in the target cgroup.
> 
> Tasks are moved directly on behalf of a request from userspace.  We
> would much prefer denying that single request than invoking the
> oom-killer on the whole group.
> 
Yes, I agree.

> Quite a lot changed in the trycharge-reclaim-retry path since 2009.
> Nowadays, charging is retried as long as reclaim is making any
> progress at all, so I don't see that it would give up moving a task
> too lightly, even without the extra OOM looping.
> 
> Is there any chance you could retry with a more recent kernel?
> 

It's curious topic.

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Enable OOM when moving processes between cgroups?
  2011-08-31 17:54 ` Johannes Weiner
  2011-09-01  0:02   ` KAMEZAWA Hiroyuki
@ 2011-09-01  0:13   ` Daisuke Nishimura
  2011-09-02 11:34   ` Viktor Rosendahl
  2 siblings, 0 replies; 5+ messages in thread
From: Daisuke Nishimura @ 2011-09-01  0:13 UTC (permalink / raw)
  To: Viktor Rosendahl
  Cc: linux-mm, KAMEZAWA Hiroyuki, Johannes Weiner, Michal Hocko,
	Daisuke Nishimura

On Wed, 31 Aug 2011 19:54:22 +0200
Johannes Weiner <jweiner@redhat.com> wrote:

> On Wed, Aug 31, 2011 at 08:32:21PM +0300, Viktor Rosendahl wrote:
> > Hello,
> > 
> > I wonder if there is a specific reason why the  OOM killer hasn't been enabled
> > in the mem_cgroup_do_precharge() function in mm/memcontrol.c ?
> > 
> > In my testing (2.6.32 kernel with some backported cgroups patches), it improves
> > the case when there isn't room for the task in the target cgroup.
> 
> Tasks are moved directly on behalf of a request from userspace.  We
> would much prefer denying that single request than invoking the
> oom-killer on the whole group.
> 
I agree. OOM is disabled intentionally at the path.

Thanks,
Daisuke Nishimura.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Enable OOM when moving processes between cgroups?
  2011-08-31 17:54 ` Johannes Weiner
  2011-09-01  0:02   ` KAMEZAWA Hiroyuki
  2011-09-01  0:13   ` Daisuke Nishimura
@ 2011-09-02 11:34   ` Viktor Rosendahl
  2 siblings, 0 replies; 5+ messages in thread
From: Viktor Rosendahl @ 2011-09-02 11:34 UTC (permalink / raw)
  To: ext Johannes Weiner
  Cc: linux-mm, Daisuke Nishimura, KAMEZAWA Hiroyuki, Michal Hocko

On 08/31/2011 08:54 PM, ext Johannes Weiner wrote:
> On Wed, Aug 31, 2011 at 08:32:21PM +0300, Viktor Rosendahl wrote:
>>
>> In my testing (2.6.32 kernel with some backported cgroups patches), it improves
>> the case when there isn't room for the task in the target cgroup.
>
> Tasks are moved directly on behalf of a request from userspace.  We
> would much prefer denying that single request than invoking the
> oom-killer on the whole group.
>

I can agree that in general this is a better policy, because in the 
general case it's not known if the userspace entity that requested the 
move prefers to cancel the move or kill something in the target group.

In my specific system it's known that we always want to kill something 
in the group, so probably this need to be a local patch.

Are there any known performance or reliability problems if OOM is 
enabled in that code patch?

> Quite a lot changed in the trycharge-reclaim-retry path since 2009.
> Nowadays, charging is retried as long as reclaim is making any
> progress at all, so I don't see that it would give up moving a task
> too lightly, even without the extra OOM looping.
>

The problem isn't really that the task moving is given up too easily; it 
seems more like it is trying too hard. The system is becoming very slow 
and unresponsive when moving the task. Our system is meant to be fairly 
interactive and responsive, that's why we would like to enable the OOM 
killer.

> Is there any chance you could retry with a more recent kernel?

Probably not with our production environment because it's an ARM based 
embedded system. If I tried to update the kernel, I would most likely 
end up with a ton of broken drivers.

Making some synthetic test case on a PC would of course be possible but 
I am not sure if it would tell that much.

best regards,

Viktor

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-02 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-31 17:32 [PATCH] Enable OOM when moving processes between cgroups? Viktor Rosendahl
2011-08-31 17:54 ` Johannes Weiner
2011-09-01  0:02   ` KAMEZAWA Hiroyuki
2011-09-01  0:13   ` Daisuke Nishimura
2011-09-02 11:34   ` Viktor Rosendahl

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).