[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080521172032.GD16367@redhat.com>
Date: Wed, 21 May 2008 13:20:32 -0400
From: Vivek Goyal <vgoyal@...hat.com>
To: Balbir Singh <balbir@...ux.vnet.ibm.com>
Cc: linux-mm@...ck.org, Sudhir Kumar <skumar@...ux.vnet.ibm.com>,
YAMAMOTO Takashi <yamamoto@...inux.co.jp>,
Paul Menage <menage@...gle.com>, lizf@...fujitsu.com,
linux-kernel@...r.kernel.org, Pavel Emelianov <xemul@...nvz.org>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [-mm][PATCH 4/4] Add memrlimit controller accounting and
control (v5)
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.
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?
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists