lkml.org 
[lkml]   [2008]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [-mm] Add an owner to the mm_struct (v7)
Paul Menage wrote:
> On Thu, Apr 3, 2008 at 11:11 AM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>> >
>> > Hmm, is this new check for delay_group_leader() safe? Won't we have
>> > called exit_cgroup() by this point, and hence be reassigned to the
>> > root cgroup? And so mm->owner->cgroups won't point to the right place?
>> >
>>
>> cgroup_exit() comes in much later after exit_mm(). Moreover delay_group_leader()
>> is a function that checks to see if
>
> Sorry, I was unclear.
>
> Yes, the call to cgroup_exit() comes much later than exit_mm() - but
> it probably does come before the other users of the mm have finished
> using the mm. So can't we end up with a situation like this?
>
> A (group leader) exits; at this point, A->mm->owner == A
> A calls exit_mm(), sees delay_group_leader(), doesn't change A->mm->owner
> A calls cgroup_exit(), A->cgroups is set to init_css_set.
> B (another thread) does something with B->mm->owner->cgroups (e.g. VM
> accounting) and accesses the wrong group

Hi, Paul,

That is indeed quite bad. Do we have to retire the group_leader to init_css_set?
Can we not check for delay_group_leader() there?

--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL


\
 
 \ /
  Last update: 2008-04-03 20:37    [W:0.069 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site