From: Jens Axboe <axboe@suse.de>
To: Lou Langholtz <ldl@aros.net>
Cc: viro@parcelfarce.linux.theplanet.co.uk,
linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
Steven Whitehouse <steve@chygwyn.com>,
akpm@digeo.com
Subject: Re: [RFC][PATCH] nbd driver for 2.5.72
Date: Sun, 22 Jun 2003 12:30:02 +0200 [thread overview]
Message-ID: <20030622103002.GK608@suse.de> (raw)
In-Reply-To: <3EF4BEC5.1060301@aros.net>
On Sat, Jun 21 2003, Lou Langholtz wrote:
> >Because often that lock protects driver-internal objects that are used
> >by all queues.
> >
> Not sure I understand what you're saying... I was going by the kernel
> blk_init_queue(q, rfn, lock) source that assigns q->queue_lock to the
> given lock pointer. Given how big struct request_queue was compared to a
> spinlock_t and since we require all disks to have there very own
> seperate struct request_queue (by virtue of all the sysfs stuff imbedded
> now in there), I'm pursauded to find requiring each request_queue to
> have its very own lock (by making queue_lock a spinlock_t rather than a
> pointer to such) a relatively low weighted addition for worthwhile gain.
> I don't doubt that I've missed something though. So unless some more
> experienced folks chime in for having queue_lock become a spinlock_t
> instead of spinlock_t *, I'll just not say anymore about queue_lock.
I don't know how to express what Al says any more clearly, looks very
clear to me. One example of such is IDE, which has two drives on one
channel and the channel is the syncronization point. So it actually
makes sense to have one lock per channel, and have that lock be shared
by the two queues (drives) on that channel.
Seems to me, you are suffering somewhat from the 'more locks is just
faster' disease. This is often not the case. ->queue_lock being a
pointer is just more powerful than having the lock embedded, because it
gives you the option to make your locking hierachy the way you want it.
So please, leave the single global nbd_lock and just use that for all
queues until you have anything close to resembling real evidence that
splitting it up is worth it. I do guarentee you that for X busy queues,
the patch you sent will be _slower_ than maintaining one single lock due
to dirty cache line bouncing.
--
Jens Axboe
next prev parent reply other threads:[~2003-06-22 10:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-21 5:43 [RFC][PATCH] nbd driver for 2.5.72 Lou Langholtz
2003-06-21 6:23 ` Pavel Machek
2003-06-21 6:36 ` Bernd Eckenfels
2003-06-21 7:42 ` Wichert Akkerman
2003-06-23 9:05 ` Lars Marowsky-Bree
2003-06-23 19:21 ` Paul Clements
2003-06-21 6:44 ` Andrew Morton
2003-06-21 15:59 ` Lou Langholtz
2003-06-21 7:04 ` Pavel Machek
2003-06-21 7:32 ` viro
2003-06-21 7:45 ` Sam Ravnborg
2003-06-21 16:39 ` Lou Langholtz
2003-06-21 19:31 ` viro
2003-06-21 20:23 ` Lou Langholtz
2003-06-22 10:30 ` Jens Axboe [this message]
2003-06-22 14:15 ` Lou Langholtz
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=20030622103002.GK608@suse.de \
--to=axboe@suse.de \
--cc=akpm@digeo.com \
--cc=ldl@aros.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=steve@chygwyn.com \
--cc=viro@parcelfarce.linux.theplanet.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