lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1330441201.2822.126.camel@dabdike.int.hansenpartnership.com>
Date:	Tue, 28 Feb 2012 09:00:01 -0600
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	Stefan Richter <stefanr@...6.in-berlin.de>
Cc:	Jens Axboe <axboe@...nel.dk>, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] [SCSI] sr: fix multi-drive performance, remove BKL
 replacement

On Tue, 2012-02-28 at 15:32 +0100, Stefan Richter wrote:
> Commit 2a48fc0ab242 "block: autoconvert trivial BKL users to private
> mutex" and other commits at the time mechanically swapped BKL for
> per-driver global mutexes.  If the sr driver is any indication, these
> replacements have still not been checked by anybody for their
> necessessity, removed where possible, or the sections they serialize
> reduced to a necessary minimum.
> 
> The sr_mutex in particular very noticably degraded performance of
> CD-DA ripping with multiple drives in parallel.  When several
> instances of "grip" are used with two or more drives, their GUIs
> became laggier, as did the KDE file manager GUI, and drive utilization
> was reduced.  (During ripping, drive lights flicker instead of staying
> on most of the time.)  IOW time to rip a stack of CDs was increased.
> I didn't measure this but it is highly noticeable.
> 
> On the other hand, I don't see what state sr_mutex would protect.
> So I removed it entirely and that works fine for me.
> 
I'm afraid you can't do that:  The problem is that we have an entangled
set of reference counts that need to be taken and released atomically.
If we don't surround them with a mutex you get undefined results from
racing last release with new acquire.  You can see this usage in sd.c.

The sr.c use case looks like bd_mutex would mediate ... but that's
because it doesn't use driver shutdown and has no power management
functions ... I think I have vague memories that someone is working on
pm for cdroms?

I don't think the mutex needs to be on the ioctls, though, which is
what's causing your performance problems, right?

James


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ