]> git.baikalelectronics.ru Git - kernel.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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 24 Feb 2020 20:01:57 +0000 (15:01 -0500)
commita56455a9e0d1670ea54790ed4eba5cd6b9e38d18
tree2ca71f96adf0db09c1a7f184fe6f17a8cfb9d367
parent54b2159d370828d19654460d12de1f6043681006
scsi: sr: get rid of sr global mutex

When replacing the Big Kernel Lock in commit f525a846c435 ("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>
drivers/scsi/sr.c
drivers/scsi/sr.h