Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756550Ab2B1Q5m (ORCPT ); Tue, 28 Feb 2012 11:57:42 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:43797 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755001Ab2B1Q5k (ORCPT ); Tue, 28 Feb 2012 11:57:40 -0500 Message-ID: <1330448257.2822.138.camel@dabdike.int.hansenpartnership.com> Subject: Re: [PATCH] [SCSI] sr: fix multi-drive performance, remove BKL replacement From: James Bottomley To: Arnd Bergmann Cc: Stefan Richter , Jens Axboe , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 28 Feb 2012 10:57:37 -0600 In-Reply-To: <201202281642.16496.arnd@arndb.de> References: <20120228153244.70413d34@stein> <20120228170930.132f7c1e@stein> <1330445795.2822.134.camel@dabdike.int.hansenpartnership.com> <201202281642.16496.arnd@arndb.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1917 Lines: 46 On Tue, 2012-02-28 at 16:42 +0000, Arnd Bergmann wrote: > On Tuesday 28 February 2012, James Bottomley wrote: > > On Tue, 2012-02-28 at 17:09 +0100, Stefan Richter wrote: > > > On Feb 28 James Bottomley wrote: > > > > > > While I do remove sr_mutex aroud scsi_cd_get/put() calls, these ones > > > internally use another lock: sr_ref_mutex. Always did, still do, since > > > neither Arnd's mechanical BKL pushdown and BKL-to-mutex conversions > > > patches nor my patch changed that. This sr_ref_mutex also protects sr's > > > reference counting outside of the three block_device_operations methods > > > which I changed. > > > > > > I suppose I could have mentioned right away in the changelog that the > > > sr driver's own reference counting serialization remains in place, via that > > > other mutex. > > > > OK, agreed ... the thing that caught my eye was the get/open and the > > release/put, but I think that's completely safe. > > I took another look and I believe the cdi->use_count in > cdrom_open/cdrom_release still requires some protection that is > currently provided by sr_mutex. So I think this is fine ... it's protected by the bdev->bd_mutex. > Some parts of cdrom_ioctl also > access this variable and things like cdi->options or cdi->keeplocked. This would be problematic because we no longer lock the ioctl. > I could imagine that you can get rid of the mutex if you turn those > into atomics and bitops, but there may be other parts of cdrom_device_info > that need locking. A safer option to solve the performance problems > could be to replace sr_mutex with a per-device mutex inside of > cdrom_device_info. I'd say the latter. James -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/