OpenVZ Forum

Home » Mailing lists » Devel » Question : memrlimit cgroup's task_move (2.6.26-rc5-mm3)
Question : memrlimit cgroup's task_move (2.6.26-rc5-mm3) [message #31139] Thu, 19 June 2008 03:14 Go to previous message
KAMEZAWA Hiroyuki is currently offline  KAMEZAWA Hiroyuki
Messages: 463
Registered: September 2006
Senior Member
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;

        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.


Containers mailing list
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC PATCH 0/4] IPC/sem - allow saving/restoring a process semundo_list
Next Topic: [patch -mm 0/4] mqueue namespace
Goto Forum:

Current Time: Thu Jun 01 09:56:55 GMT 2023

Total time taken to generate the page: 0.01849 seconds