Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1518023ybv; Fri, 14 Feb 2020 01:04:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxq9T2mNSCDqyRFNSS9ZHTngYQYgNXCpomJaTmLPXa55sUh8BeW0AX5HKZ80Prak5L4WL+E X-Received: by 2002:a9d:4c8e:: with SMTP id m14mr1351996otf.245.1581671039960; Fri, 14 Feb 2020 01:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581671039; cv=none; d=google.com; s=arc-20160816; b=T0CiPfhej5vw6u4+OjgM5jdGzaWmJCS7xWn0tA8QoEY7eR72AHli1S7yiae0SUZdrr 73fXkArNUAKVJ1dBr1cPF5IX/X1Qj7geWcyW5ONSRGEVdWRyplIr7PsM9zcQcRspqwb1 xQq6XcRgv29eMUqO17SN5alQjp0MemtDLwHk8TCCxueZyCmISWrW501f1/CjPqaeQkjI NFWMnKK9UXEl3QvAYrE0JIF+tAz+VP10wke9Od0dGQ2iLOTx5Ma+v9Qo3rut/wPBYnlk 8gAz1zSKxI+30pdjfpxPZ+kqyrtkcns+6XXL/yeTJEIT9mJHmH3j1Os9creegmsR21Ak gAsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=yO9RRsh63vb5ObuKpQQmJhSpeIjjomT6RUrEqb5f8Tk=; b=UVDoAAh76SwDCj9zcha7gcISsrEQzpXbetn7aLrdqWgwdId0pzPnLtBYrIRw4Or6wN syAoX0a5nCPKst/UWl/t7biSzS0D0CxBzesM6ZOWTETVCeenVRVExEgmwHRWEQGXODNX TTg7gLU4e/xJkZgfrAqba/aOj1Tnb7cpzvi3OqyrQ2ojDV30NJj38d+iKsKDNN88ldM+ 6prAlPAib1aJffBwrmVeKD9156vr3EIoEqucB2k+A9tjNAHr3EikK4Myx+b9t45Zs41q tHt5c17xX+QofH+M6CblJZMUdONE9GHqDNmUmVKcSszpPxmg6RMjN3Al6HJ83FWru+px T6cw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si2787940oti.301.2020.02.14.01.03.47; Fri, 14 Feb 2020 01:03:59 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729073AbgBNJDh (ORCPT + 99 others); Fri, 14 Feb 2020 04:03:37 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:44313 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729048AbgBNJDh (ORCPT ); Fri, 14 Feb 2020 04:03:37 -0500 Received: from mail-qk1-f170.google.com ([209.85.222.170]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPSA (Nemesis) id 1Mr8O8-1jnOoj2bkE-00oIej; Fri, 14 Feb 2020 10:03:35 +0100 Received: by mail-qk1-f170.google.com with SMTP id b7so8501974qkl.7; Fri, 14 Feb 2020 01:03:35 -0800 (PST) X-Gm-Message-State: APjAAAVnIzSCk5a6AcxaOAl8TnH2UCawUIWxg3YVy91JKyF2NsX3AtKx p6KUBIxNK9o+Ug3i2tsWjhLCwrp6s/X/pE2nDoA= X-Received: by 2002:a37:e409:: with SMTP id y9mr1537895qkf.352.1581671014406; Fri, 14 Feb 2020 01:03:34 -0800 (PST) MIME-Version: 1.0 References: <20200212164445.1171-1-merlijn@wizzup.org> In-Reply-To: <20200212164445.1171-1-merlijn@wizzup.org> From: Arnd Bergmann Date: Fri, 14 Feb 2020 10:03:18 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] scsi: sr: get rid of sr global mutex To: Merlijn Wajer Cc: linux-scsi , Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:vADYcuYB5RZ8TUS9STQURFbdD6Zxn/5udk+ygAXQ9Ug6KUAGvv6 YlAjdoJGIZkLlY8zH/h00AQBQhOtoVHslHr6knGD6R+ZcaoiLkQW8iXbGvK1KdcXKFY6gqQ nmuwKYqHwbPdMW75ikZ/hiINnMqfPKqwAN+4FOpaa7tQcyeLCeDraRYS026hBr5zhR/tfyr 1SztTA7DJg4NkqYFxlndQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:DEsMw8tusYk=:VT8KzzbnE1h7eVLjRBdf0/ cswPT3mEkoyX+lLm3MoBlnrLge9n6ev2MNpCuk5LKLBQvKRSKRVEr2oArOdBWFQN5tpmMILSR rly1NHRrrc4UeVtWmcDECwawbmbFdF/AV0z1Hz8LRLBg0neeJiw8DJh4Pk4jnQBQsOqulCtBc CvdBGDiSKFN26NdNrK8FFrxVLLmyFFklKOf6WO1FdUcVdOqOj68phoOvuiOakXn5rhy2GLHeu f/EUUmxPBGZ/5LVxvtLLGWUX4QZaObCsIBszR6woz2HjMSXeRJR6kBG77r33eZ9SG0J9VIbnO 9lhRN/WEm/RBvrtiJIl4mRjyxBJqKEH+HfoI+4JEJS+SUXpv9xzVeZ2Moyx0xqFKALkTDK6fJ yF9r8rXwkBc0Evl00KUb61NK5Gdc2QvuF0B9tVMDKGKRMEulZOF88kPCFhvPS5S5QKjRxS1wJ Tzvm8sc/KtogJsV0GIlezlXoxl2Ubck05vQ3Kl3uLOyRHwgSjl7oEueBAk+WiSWQ9RuhDWdLY lVN0xgSDYrFvPIKMhwaimILe1bSwxnCiqOySS5fy+2oGjnt6dUSToYoSmPr/qeGnmTPEiD4Fi 0Mfd1QBi29DlVJ+bgXXQXeCQfvMZvo5/Fr9oMOsAWtKYButA7hze/ZwTF57Lwmu/iuCJiwQdX gWMKbsCQ+UBxtkKVg3DdD1jRvOmkkifdIcHEcmEf8fL/VsXhthpNbmvS7gYg3z9fFab/bnwhN ZOLqCJLEQ2HgwMPmYwx4NwPcEPce+Fh809qB+wc+ib4JzZ625q3n2V8nOc4nynavTr7+vL77x xSyON6g+tQjt3TXnn+/QVtifMWNO8OQixSAmrKyJe23hjW3FUk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 12, 2020 at 5:45 PM 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. > > 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 > > Signed-off-by: Merlijn Wajer This all looks reasonable to me. The conversion from BKL to a per-driver mutex was done in a mostly automated way, and I did not attempt to make it more fine-grained then. I don't see any global state accessed in the open/close/ioctl functions, so this is probably completely safe. It may even be possible to avoid that mutex completely, but that is harder to prove. Acked-by: Arnd Bergmann