From: James Bottomley <jejb@linux.ibm.com>
To: Christoph Hellwig <hch@infradead.org>,
Merlijn Wajer <merlijn@archive.org>
Cc: merlijn@wizzup.org, linux-scsi@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] scsi: sr: get rid of sr global mutex
Date: Tue, 18 Feb 2020 09:20:28 -0800 [thread overview]
Message-ID: <1582046428.16681.7.camel@linux.ibm.com> (raw)
In-Reply-To: <20200218171259.GA6724@infradead.org>
On Tue, 2020-02-18 at 09:12 -0800, Christoph Hellwig wrote:
> On Tue, Feb 18, 2020 at 03:39:17PM +0100, Merlijn Wajer wrote:
> > When replacing the Big Kernel Lock in commit
> > 2a48fc0ab24241755dc93bfd4f01d68efab47f5a ("block: autoconvert
> > trivial BKL users to private mutex"), the lock was replaced with a
> > sr-wide lock.
> >
> > This causes very poor performance when using multiple sr devices,
> > as the sr driver was not able to execute more than one command to
> > one drive at any given time, even when there were many CD drives
> > available.
> >
> > Replace the global mutex with per-sr-device mutex.
>
> Do we actually need the lock at all? What is protected by it?
We do at least for cdrom_open. It modifies the cdi structure with no
other protection and concurrent modification would at least screw up
the use counter which is not atomic. Same reasoning for cdrom_release.
I think the ioctls don't need the mutex (not looked deeply enough) and
certainly the probe only requires it for the idr allocation which has
its own lock, so I don't believe the mutex additions are needed there.
James
next prev parent reply other threads:[~2020-02-18 17:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 14:39 [PATCH v2] scsi: sr: get rid of sr global mutex Merlijn Wajer
2020-02-18 17:12 ` Christoph Hellwig
2020-02-18 17:20 ` James Bottomley [this message]
2020-02-18 17:23 ` Christoph Hellwig
2020-02-18 17:28 ` James Bottomley
2020-02-18 17:31 ` Christoph Hellwig
2020-02-18 19:21 ` Merlijn B.W. Wajer
2020-02-18 19:46 ` Arnd Bergmann
2020-02-24 21:20 ` Merlijn B.W. Wajer
[not found] <9d50ecd4-9fd1-6865-5509-a5ef119828df () archive ! org>
2020-03-06 22:43 ` Simon Arlott
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=1582046428.16681.7.camel@linux.ibm.com \
--to=jejb@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=merlijn@archive.org \
--cc=merlijn@wizzup.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.