lkml.org 
[lkml]   [2020]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] scsi: sr: get rid of sr global mutex
From
Date
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

\
 
 \ /
  Last update: 2020-02-18 18:23    [W:0.036 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site