lkml.org 
[lkml]   [2008]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [-mm][PATCH 4/4] Add memrlimit controller accounting and control (v5)
Vivek Goyal wrote:
> On Wed, May 21, 2008 at 09:00:12PM +0530, Balbir Singh wrote:
>
> [..]
>> +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;
>> +
>> + mm = get_task_mm(p);
>> + if (mm == NULL)
>> + return;
>> +
>> + /*
>> + * Hold mmap_sem, so that total_vm does not change underneath us
>> + */
>> + down_read(&mm->mmap_sem);
>> +
>> + rcu_read_lock();
>> + if (p != rcu_dereference(mm->owner))
>> + goto out;
>> +
>
> Hi Balbir,
>
> How does rcu help here? We are not dereferencing mm->owner. So even if
> task_struct it was pointing to goes away, should not be a problem.
>

Yes, you are right, since we already have information about the cgroup and new
cgroup, mm->owner's exit should not really cause a problem

> OTOH, while updating the mm->owner in mmm_update_next_owner(), we
> are not using rcu_assing_pointer() and synchronize_rcu()/call_rcu(). Is
> this the right usage if mm->owner is rcu protected?
>

Yes, you are correct - I'll send out updates on top of this one.

> Thanks
> Vivek
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>


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


\
 
 \ /
  Last update: 2008-05-22 06:55    [W:0.086 / U:1.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site