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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131125103751.GC23813@opentech.at>
Date:	Mon, 25 Nov 2013 11:37:51 +0100
From:	Nicholas Mc Guire <der.herr@...r.at>
To:	David Laight <David.Laight@...LAB.COM>
Cc:	David Miller <davem@...emloft.net>, kuznet@....inr.ac.ru,
	eric.dumazet@...il.com, roque@...fc.ul.pt, peterz@...radead.org,
	netdev@...r.kernel.org
Subject: Re: [PATCH] rebalance locks by converting write_lock_bh
	towrite_lock+local_bh_disable

On Mon, 25 Nov 2013, David Laight wrote:

> > in one of the cases I do not understand the intent behind the split:
> > in net/core/sock.c:lock_sock_fast
> > 
> > 	spin_lock_bh(&sk->sk_lock.slock);
> > 	...
> >         spin_unlock(&sk->sk_lock.slock);
> >         /*
> >          * The sk_lock has mutex_lock() semantics here:
> >          */
> >         mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_);
> >         local_bh_enable();
> > 
> >  I think that
> > 
> > 	spin_lock_bh(&sk->sk_lock.slock);
> > 	...
> >         /*
> >          * The sk_lock has mutex_lock() semantics here:
> >          */
> >         mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_);
> >         spin_unlock_bh(&sk->sk_lock.slock);
> > 
> >  should be equivalent ?
> 
> You've added a lock ordering that wasn't there before.
> Also I suspect that mutex_acquire() might be allowed to sleep,
> whereas you shouldn't sleep with a spin lock held.
>
mutex_acquire is not a lock but a lockdep entry. 
As far as I understand it it nither can sleep nor is there a change of 
order here. Am I missing something ?

thx!
hofrat
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ