On Wed, Jun 24, 2015 at 05:12:12PM +0200, Oleg Nesterov wrote:
> On 06/24, Peter Zijlstra wrote:
> > I'm confused.. why isn't the read-in-read recursion good enough?
>
> Because the code above can actually deadlock if 2 CPU's do this at
> the same time?
Hmm yes.. this makes the hotplug locking w
On 06/24, Peter Zijlstra wrote:
>
> On Wed, Jun 24, 2015 at 03:50:49PM +0200, Oleg Nesterov wrote:
> > On 06/23, Peter Zijlstra wrote:
> > > If in one callchain we do:
> > >
> > > get_online_cpus();
> > > lock(A);
> > >
> > > in another we do:
> > >
> > > lock(A);
> > > get_online_cpus();
>
On Wed, Jun 24, 2015 at 03:50:49PM +0200, Oleg Nesterov wrote:
> On 06/23, Peter Zijlstra wrote:
> > If in one callchain we do:
> >
> > get_online_cpus();
> > lock(A);
> >
> > in another we do:
> >
> > lock(A);
> > get_online_cpus();
> >
> > lockdep will complain about the inverted
On 06/23, Peter Zijlstra wrote:
>
> On Tue, Jun 23, 2015 at 07:01:22PM +0200, Oleg Nesterov wrote:
> > On 06/23, Peter Zijlstra wrote:
> > >
> > > On Tue, Jun 23, 2015 at 12:57:39AM +0200, Oleg Nesterov wrote:
> > > > > +
> > > > > + lock_map_acquire_read(&cpu_hotplug.rwsem.rw_sem.dep_map);
> >
On Tue, Jun 23, 2015 at 07:01:22PM +0200, Oleg Nesterov wrote:
> On 06/23, Peter Zijlstra wrote:
> >
> > On Tue, Jun 23, 2015 at 12:57:39AM +0200, Oleg Nesterov wrote:
> > > > +
> > > > + lock_map_acquire_read(&cpu_hotplug.rwsem.rw_sem.dep_map);
> > > > + _percpu_down_read(&cpu_hotplug.
On 06/23, Peter Zijlstra wrote:
>
> On Tue, Jun 23, 2015 at 12:57:39AM +0200, Oleg Nesterov wrote:
> > > +
> > > + lock_map_acquire_read(&cpu_hotplug.rwsem.rw_sem.dep_map);
> > > + _percpu_down_read(&cpu_hotplug.rwsem);
> > > }
> >
> > Confused... Why do we need _percpu_down_read()? Can't get_onli
On Tue, Jun 23, 2015 at 12:57:39AM +0200, Oleg Nesterov wrote:
> > +
> > + lock_map_acquire_read(&cpu_hotplug.rwsem.rw_sem.dep_map);
> > + _percpu_down_read(&cpu_hotplug.rwsem);
> > }
>
> Confused... Why do we need _percpu_down_read()? Can't get_online_cpus()
> just use percpu_down_read() ?
>
On 06/22, Peter Zijlstra wrote:
>
> The cpu hotplug lock is a rwsem with read-in-write and read-in-read
> recursion. Implement it as such.
And this patch fixes the problem afaics. Currently cpu_hotplug_begin()
can livelock because it doesn't stop the new readers. With this patch
this is no longer
The cpu hotplug lock is a rwsem with read-in-write and read-in-read
recursion. Implement it as such.
Signed-off-by: Peter Zijlstra (Intel)
---
include/linux/cpu.h |6 +
include/linux/percpu-rwsem.h | 10 ++-
include/linux/sched.h|4 +
init/main.c |
9 matches
Mail list logo