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, 5 Feb 2013 11:22:48 -0500
From:	Benjamin LaHaise <bcrl@...ck.org>
To:	Nicholas Thomas <nick@...emark.co.uk>
Cc:	Paul.Clements@...eleye.com, jaxboe@...ionio.com,
	netdev@...r.kernel.org, hkchu@...gle.com, davem@...emloft.net,
	eric.dumazet@...il.com
Subject: Re: [PATCH] NBD: Move from a global spinlock to one lock per NBD device

On Tue, Feb 05, 2013 at 04:14:27PM +0000, Nicholas Thomas wrote:
> This patch is entirely based on a submission by Jerry Chu, incorporating
> suggestions from Eric Dumazet. Modern, faster NICs make the original comment
> on why a single lock is preferable incorrect; moving to one lock per NBD
> device removes a performance bottleneck.
> 
> Original patch: http://permalink.gmane.org/gmane.linux.network/207233
...
> +static spinlock_t *nbd_locks __read_mostly;
...

This is about the worst way to split up a lock possible.  Most (all?) of the 
spinlocks across nbd devices are on the same cacheline, so performance will 
be limited by the rate of cacheline bounces for the lock.  It would be far 
better to embed the spinlock in the data structures that it will be 
protecting to avoid this expensive false-sharing.

		-ben
--
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