[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190628143109.GX26005@localhost.localdomain>
Date: Fri, 28 Jun 2019 16:31:09 +0200
From: Juri Lelli <juri.lelli@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...hat.com, rostedt@...dmis.org, tj@...nel.org,
linux-kernel@...r.kernel.org, luca.abeni@...tannapisa.it,
claudio@...dence.eu.com, tommaso.cucinotta@...tannapisa.it,
bristot@...hat.com, mathieu.poirier@...aro.org, lizefan@...wei.com,
cgroups@...r.kernel.org
Subject: Re: [PATCH v8 5/8] cgroup/cpuset: convert cpuset_mutex to
percpu_rwsem
Hi,
On 28/06/19 14:45, Peter Zijlstra wrote:
> On Fri, Jun 28, 2019 at 10:06:15AM +0200, Juri Lelli wrote:
> > @@ -2154,7 +2154,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)
> > cpuset_attach_old_cs = task_cs(cgroup_taskset_first(tset, &css));
> > cs = css_cs(css);
> >
> > - mutex_lock(&cpuset_mutex);
> > + percpu_down_read(&cpuset_rwsem);
> >
> > /* allow moving tasks into an empty cpuset if on default hierarchy */
> > ret = -ENOSPC;
> > @@ -2178,7 +2178,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)
> > cs->attach_in_progress++;
> > ret = 0;
> > out_unlock:
> > - mutex_unlock(&cpuset_mutex);
> > + percpu_up_read(&cpuset_rwsem);
> > return ret;
> > }
> >
> > @@ -2188,9 +2188,9 @@ static void cpuset_cancel_attach(struct cgroup_taskset *tset)
> >
> > cgroup_taskset_first(tset, &css);
> >
> > - mutex_lock(&cpuset_mutex);
> > + percpu_down_read(&cpuset_rwsem);
> > css_cs(css)->attach_in_progress--;
> > - mutex_unlock(&cpuset_mutex);
> > + percpu_up_read(&cpuset_rwsem);
> > }
>
> These are the only percpu_down_read()s introduced in this patch; are we
> sure this is correct? Specifically, what serializes
> ->attach_in_progress?
No, I think it's wrong, sorry. I'll change to the write variant in next
version.
Thanks,
Juri
Powered by blists - more mailing lists