lkml.org 
[lkml]   [2008]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][-mm] Add an owner to the mm_struct (v4)
On Tue, Apr 1, 2008 at 8:25 PM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
> > +assign_new_owner:
> > + rcu_read_unlock();
> > + BUG_ON(c == p);
> > + task_lock(c);
> > + if (c->mm != mm) {
> > + task_unlock(c);
> > + goto retry;
> > + }
> > + cgroup_mm_owner_callbacks(mm->owner, c);
> > + mm->owner = c;
> > + task_unlock(c);
> > +}
> > Why rcu_read_unlock() before changing owner ? Is it safe ?
> >
>
> It should be safe, since we take task_lock(), but to be doubly sure, we can drop
> rcu read lock after taking the task_lock().
>

I agree with Kamezawa - the task can technically disappear as soon as
we leave the RCU critical section. (In practice, it'll only happen
with CONFIG_PREEMPT).

Paul


\
 
 \ /
  Last update: 2008-04-02 21:31    [W:0.057 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site