Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6076344ybv; Tue, 18 Feb 2020 09:23:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxJSvM/JkAaUtfS5Mlga8fK6fz3SqDVvFX6wZuES1Cy2cV/r8ZVOKcAK2QZ/9C9Dyl9em3o X-Received: by 2002:a05:6808:218:: with SMTP id l24mr1832692oie.108.1582046636184; Tue, 18 Feb 2020 09:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582046636; cv=none; d=google.com; s=arc-20160816; b=vZcg5lTDev/fZX5NPMejEOFvMU8J2b6Y4LzjtTRdY7x8GVs+WvosM6S5V7UfFcnt0t o7j8+31s1taSYD25OlI7hInKVq/Afdp+5jG2473czEjKIetBKJzJBO5wW3uB8KnwjbR7 8dMs4g9KPvJFPhmyPFnjV2ozA569hImLKYT5197g78ZShXqh2ciXmisq5O7OW0kfXmzF jEuE1kc0UxMCZ+RBQBCT0Dr0i8w08liqlrJ7F+ysd5HJnpTqw5rqPX+KrW6NwjcrEXob bfyVz5H19rS4UJeqs+oHqqdSVCdaW9NqfU9pHRbUFrnsuus9wFY+nFFz98BU6oiOFvze yCiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=u37UAd58TwwLqH13wgX4KxR2TlIhKdFdrJccQ+hB7go=; b=t5FoYQv0Xnnw1dIHhwZmYHVLupH2uQ9bx7diWns9cQP5lO0Q1P8ZhkAIjxheXyvWg3 Ry7ZhG6sB0ksZi8IpP23gcJjFJjNxBADbqk8X561qcaEWGkJwRjXFMKgDxSbm1+Hrm5a HAq4Jpu916brxPfKHk9iTjO0sD6xHe3FmrKXsr74HM5Q6VZmUlzMa6dqCSYQD/3jJOXP uA/xlZ5BgLxAAQkGxBt3OFzsMn1slLmMBGj0cSLCEj0dJFZybjyJ6QQGBo6KUcOSnUz8 TpcGwm/bWdlc2I/eAHLrn4dTo9P/tfcu+77u6v9ElXdkgeIooM5/ZULiUS3W+rqKIhK+ Quyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si7580764oih.41.2020.02.18.09.23.43; Tue, 18 Feb 2020 09:23:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbgBRRWX (ORCPT + 99 others); Tue, 18 Feb 2020 12:22:23 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53870 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726411AbgBRRWX (ORCPT ); Tue, 18 Feb 2020 12:22:23 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01IHJHDR141152; Tue, 18 Feb 2020 12:20:34 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y6e1hvtp9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Feb 2020 12:20:34 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01IHCKgV002392; Tue, 18 Feb 2020 17:20:33 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma01dal.us.ibm.com with ESMTP id 2y6896ju1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Feb 2020 17:20:33 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01IHKW0W58917332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Feb 2020 17:20:32 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1547513605D; Tue, 18 Feb 2020 17:20:32 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04AD313604F; Tue, 18 Feb 2020 17:20:29 +0000 (GMT) Received: from jarvis.ext.hansenpartnership.com (unknown [9.80.237.10]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 18 Feb 2020 17:20:29 +0000 (GMT) Message-ID: <1582046428.16681.7.camel@linux.ibm.com> Subject: Re: [PATCH v2] scsi: sr: get rid of sr global mutex From: James Bottomley To: Christoph Hellwig , Merlijn Wajer Cc: merlijn@wizzup.org, linux-scsi@vger.kernel.org, Jens Axboe , "Martin K. Petersen" , Arnd Bergmann , linux-kernel@vger.kernel.org Date: Tue, 18 Feb 2020 09:20:28 -0800 In-Reply-To: <20200218171259.GA6724@infradead.org> References: <20200218143918.30267-1-merlijn@archive.org> <20200218171259.GA6724@infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-18_04:2020-02-18,2020-02-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 adultscore=0 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxlogscore=818 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002180123 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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