linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Merlijn Wajer <merlijn@wizzup.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] scsi: sr: get rid of sr global mutex
Date: Fri, 14 Feb 2020 10:03:18 +0100	[thread overview]
Message-ID: <CAK8P3a2eBrAoksG11LE0CMSKg4ZW1GYTj4N2SmJ-CYQfP1-c8A@mail.gmail.com> (raw)
In-Reply-To: <20200212164445.1171-1-merlijn@wizzup.org>

On Wed, Feb 12, 2020 at 5:45 PM Merlijn Wajer <merlijn@wizzup.org> 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.
>
> Someone tried this patch at the time, but it never made it
> upstream, due to possible concerns with race conditions, but it's not
> clear the patch actually caused those:
>
> https://www.spinics.net/lists/linux-scsi/msg63706.html
> https://www.spinics.net/lists/linux-scsi/msg63750.html
>
> Also see
>
> http://lists.xiph.org/pipermail/paranoia/2019-December/001647.html
>
> Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>

This all looks reasonable to me. The conversion from BKL to a per-driver
mutex was done in a mostly automated way, and I did not attempt to make
it more fine-grained then.

I don't see any global state accessed in the open/close/ioctl functions,
so this is probably completely safe. It may even be possible to avoid
that mutex completely, but that is harder to prove.

Acked-by: Arnd Bergmann <arnd@arndb.de>

      parent reply	other threads:[~2020-02-14  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 16:44 [RFC PATCH] scsi: sr: get rid of sr global mutex Merlijn Wajer
2020-02-13 21:11 ` Merlijn Wajer
2020-02-14  9:03 ` Arnd Bergmann [this message]

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=CAK8P3a2eBrAoksG11LE0CMSKg4ZW1GYTj4N2SmJ-CYQfP1-c8A@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --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 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).