lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 23 Jun 2015 19:53:18 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	paulmck@...ux.vnet.ibm.com, tj@...nel.org, mingo@...hat.com,
	linux-kernel@...r.kernel.org, der.herr@...r.at, dave@...olabs.net,
	riel@...hat.com, viro@...IV.linux.org.uk,
	torvalds@...ux-foundation.org
Subject: Re: [RFC][PATCH 09/13] hotplug: Replace hotplug lock with
 percpu-rwsem

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.rwsem);
> > > >  }
> > >
> > > Confused... Why do we need _percpu_down_read()? Can't get_online_cpus()
> > > just use percpu_down_read() ?
> > >
> > > Yes, percpu_down_read() is not recursive, like the normal down_read().
> > > But this does not matter because we rely on ->cpuhp_ref anyway?
> >
> > While we will not call the actual lock, lockdep will still get confused
> > by the inconsistent locking order observed.
> >
> > Change it and boot, you'll find lockdep output pretty quickly.
> 
> Hmm. and I simply can't understand why...

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 lock order, however this is not
a problem at all for recursive locks.

I think the example you get on boot is slightly more complicated, but
ends up like the above iirc.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ