[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTiki=aXr3KMXwrnnTrLC2Wt1F0eG8sVdXWiZrVFa@mail.gmail.com>
Date: Thu, 17 Feb 2011 15:51:47 -0800
From: Paul Menage <menage@...gle.com>
To: Li Zefan <lizf@...fujitsu.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
David Rientjes <rientjes@...gle.com>,
缪 勰 <miaox@...fujitsu.com>,
linux-mm@...ck.org
Subject: Re: [PATCH 4/4] cpuset: Hold callback_mutex in cpuset_clone()
On Wed, Feb 16, 2011 at 5:50 PM, Li Zefan <lizf@...fujitsu.com> wrote:
> Chaning cpuset->mems/cpuset->cpus should be protected under
> callback_mutex.
>
> cpuset_clone() doesn't follow this rule. It's ok because it's
> called when creating and initializing a cgroup, but we'd better
> hold the lock to avoid subtil break in the future.
>
> Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Acked-by: Paul Menage <menage@...gle.com>
Patch title should be s/cpuset_clone/cpuset_post_clone/
> ---
> kernel/cpuset.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 1e18d26..445573b 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -1840,8 +1840,10 @@ static void cpuset_post_clone(struct cgroup_subsys *ss,
> cs = cgroup_cs(cgroup);
> parent_cs = cgroup_cs(parent);
>
> + mutex_lock(&callback_mutex);
> cs->mems_allowed = parent_cs->mems_allowed;
> cpumask_copy(cs->cpus_allowed, parent_cs->cpus_allowed);
> + mutex_unlock(&callback_mutex);
> return;
> }
>
> --
> 1.7.3.1
>
--
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