]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: sr: get rid of sr global mutex
authorMerlijn Wajer <merlijn@archive.org>
Tue, 18 Feb 2020 14:39:17 +0000 (15:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:13:46 +0000 (16:13 +0200)
commit6138fc62e208ffeb877009157d01183e76b39df6
treedc22dcfdcafe0169ae7c867778d0f47ad128c5ab
parent9c6e9d82f29ef16564b74d6c07e5cece00aa94e0
scsi: sr: get rid of sr global mutex

commit 51a858817dcdbbdee22cb54b0b2b26eb145ca5b6 upstream.

When replacing the Big Kernel Lock in commit 2a48fc0ab242 ("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

Link: https://lore.kernel.org/r/20200218143918.30267-1-merlijn@archive.org
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Merlijn Wajer <merlijn@archive.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/sr.c
drivers/scsi/sr.h