From: Benjamin LaHaise <bcrl@kvack.org>
To: Nicholas Thomas <nick@bytemark.co.uk>
Cc: Paul.Clements@steeleye.com, jaxboe@fusionio.com,
netdev@vger.kernel.org, hkchu@google.com, davem@davemloft.net,
eric.dumazet@gmail.com
Subject: Re: [PATCH] NBD: Move from a global spinlock to one lock per NBD device
Date: Tue, 5 Feb 2013 11:22:48 -0500 [thread overview]
Message-ID: <20130205162248.GG20842@kvack.org> (raw)
In-Reply-To: <1360080867.18869.30.camel@eboracum.office.bytemark.co.uk>
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
next prev parent reply other threads:[~2013-02-05 16:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 15:55 [PATCH] Break up the single NBD lock into one per NBD device Nicholas Thomas
2013-02-05 14:51 ` Jerry Chu
2013-02-05 16:14 ` [PATCH] NBD: Move from a global spinlock to one lock " Nicholas Thomas
2013-02-05 16:22 ` Benjamin LaHaise [this message]
2013-02-05 21:31 ` Paul Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130205162248.GG20842@kvack.org \
--to=bcrl@kvack.org \
--cc=Paul.Clements@steeleye.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hkchu@google.com \
--cc=jaxboe@fusionio.com \
--cc=netdev@vger.kernel.org \
--cc=nick@bytemark.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).