lkml.org 
[lkml]   [2011]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] cgroup: introduce cgroup_taskset and use it in subsys->can_attach(), cancel_attach() and attach()
On Thu, 25 Aug 2011 10:20:49 +0200
Tejun Heo <tj@kernel.org> wrote:

> Hello, KAMEZAWA.
>

> > > @@ -5460,8 +5460,9 @@ static void mem_cgroup_clear_mc(void)
> > >
> > > static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
> > > struct cgroup *cgroup,
> > > - struct task_struct *p)
> > > + struct cgroup_taskset *tset)
> > > {
> > > + struct task_struct *p = cgroup_taskset_first(tset);
> > > int ret = 0;
> > > struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
> > >
> >
> > Ah..hmm. I think this doesn't work as expected for memcg.
> > Maybe code like this will be required.
>
> Hmmm... the above is basically identity transformation of the existing
> code. If the above is broken, the current code is broken too. Is it?
>
Current code is not broken.

mem_cgroup_can_attach(....., task) need to do real job only when task->mm->owner
== task. In this modification, you pass a set of task at once.
So, mem_cgroup_can_attach() need to check _all_ tasks in tset rather than a
first task in tset. please scan and find mm->owner.

Anyway, if you merge this onto mm-tree first, I think I can have time to
write a fix up if complicated.

Thanks,
-Kame



\
 
 \ /
  Last update: 2011-08-25 10:31    [W:0.331 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site