All of lore.kernel.org
 help / color / mirror / Atom feed
* Question : memrlimit cgroup's task_move (2.6.26-rc5-mm3)
@ 2008-06-19  3:14 ` KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 20+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-06-19  3:14 UTC (permalink / raw)
  To: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
  Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
	menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org

I used memrlimit cgroup at the first time.

May I ask a question about memrlimit cgroup ?

In following 
==
static void memrlimit_cgroup_move_task(struct cgroup_subsys *ss,
                                        struct cgroup *cgrp,
                                        struct cgroup *old_cgrp,
                                        struct task_struct *p)
{
        struct mm_struct *mm;
        struct memrlimit_cgroup *memrcg, *old_memrcg;

<snip>
        if (res_counter_charge(&memrcg->as_res, (mm->total_vm << PAGE_SHIFT)))
                goto out;
        res_counter_uncharge(&old_memrcg->as_res, (mm->total_vm << PAGE_SHIFT));
==
This is a callback for task_attach(). and this never fails.

What happens when the moved task, which move-of-charge fails, exits ?

==
% mkdir /dev/cgroup/memrlimit/group_01
% mkdir /dev/cgroup/memrlimit/group_02
% echo 1G > /dev/cgroup/memrlimit/group_01/memrlimit.limit_in_bytes
% echo 0 >  /dev/cgroup/memrlimit/group_02/memrlimit.limit_in_bytes
% echo $$ > /dev/cgroup/memrlimit/group_01/tasks
% echo $$ > /dev/cgroup/memrlimit/group_02/tasks
% exit
== you'll see WARNING ==

I think the charge of the new group goes to minus. right ?
(and old group's charge never goes down.)
I don't think this is "no problem".

What kind of patch is necessary to fix this ?
task_attach() should be able to fail in future ?

I'm sorry if I misunderstand something or this is already in TODO list.

Thanks,
-Kame

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

end of thread, other threads:[~2008-06-20 13:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19  3:14 Question : memrlimit cgroup's task_move (2.6.26-rc5-mm3) KAMEZAWA Hiroyuki
2008-06-19  3:14 ` KAMEZAWA Hiroyuki
     [not found] ` <20080619121435.f868c110.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-19  3:13   ` Balbir Singh
2008-06-19  3:13     ` Balbir Singh
     [not found]     ` <4859CEE7.9030505-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-06-19  3:24       ` KAMEZAWA Hiroyuki
2008-06-19  3:24         ` KAMEZAWA Hiroyuki
     [not found]         ` <20080619122429.138a1d32.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-19 10:22           ` KAMEZAWA Hiroyuki
2008-06-19 10:22             ` KAMEZAWA Hiroyuki
     [not found]             ` <20080619192227.972ded64.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-19 12:30               ` Balbir Singh
2008-06-19 12:30                 ` Balbir Singh
2008-06-19 16:41               ` Balbir Singh
2008-06-19 16:41                 ` Balbir Singh
     [not found]             ` <485A5160.5070901-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-06-19 13:38               ` kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A
2008-06-19 13:38                 ` kamezawa.hiroyu
2008-06-19 18:25   ` Balbir Singh
2008-06-19 18:25     ` Balbir Singh
     [not found]     ` <20080619182556.GA10461-SINUvgVNF2CyUtPGxGje5AC/G2K4zDHf@public.gmane.org>
2008-06-20  0:13       ` KAMEZAWA Hiroyuki
2008-06-20  0:13         ` KAMEZAWA Hiroyuki
     [not found]         ` <20080620091316.80771d14.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-20 13:33           ` Balbir Singh
2008-06-20 13:33             ` Balbir Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.