Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3851265pxb; Tue, 26 Jan 2021 06:28:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrJWsqyLlUSnQl0ujNgCpwPws/BoftbJmUGSTnMgzNODb2jepF1XQS7Ua9SMRoB/0V5Cm6 X-Received: by 2002:a05:6402:438d:: with SMTP id o13mr4719454edc.135.1611671322370; Tue, 26 Jan 2021 06:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611671322; cv=none; d=google.com; s=arc-20160816; b=d/NsZaOo/dqCraSJeQQhJ4yzoVlm5VLqsB1LbqVICbfmESjpLbQi2ffN62JSIfLa1s yruqYGpQ8DRMmDVK1IC6LATuGHNPTcg8mET+ZOnHu+2lJW2U9WaBMZZWRHcOTqTdVPD2 yTRmBKCFcNIp1hVzKrCpAj2Su2x/+d5XuXDu6Gz+ni1QKqzgFaUEwNLtvWMSt6Gwujy3 pXnszh0bVmXBs8m6gQk5KS/EJm922mO+JB671oCP+tG1biMhwp4JK1V7eoW3kLHq3EZ8 G0V6BOpY5hoZbqjf+zbCUYvkiShTX/4NHsZY00rKaxSSF+gYlJGghKSn2TlTU2oA0nSn 9DBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1czbBZLLxHwEsDj/a0a94VF0yBz3u23rkRDZfhlmeos=; b=to1E9Ji6A7t7P6xt7AL783Fgu1nXl3A2AIGCNltTrHPcpM3ZKdSmDBTGuxtuw7fshb xA9pccE8KXtEK6j7XBQDzu40bWdILC0dWs3vBA7G/2IzkIYUarkrDINiCPppn25fInzX db834yK8gUyokjh0HlOJySLhYYRXM7FFdnde1U7yVxTNylMogOS/FO1ZkEoxMUjOwpqi 7okUAPgSAMS60wBMfDN8X3DWZCXTINfAFUHqvgGSj3bWouSSWWIzWlOxMp8PkHQwWXzN e8nWmFhNipBwhh6bSfQwJanQ1aCblukwjs1Om3jAc6mbgzQTqEEK3N5QnSQLTnaz97AT wjgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=nyCAT2Re; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se5si7278756ejb.632.2021.01.26.06.28.15; Tue, 26 Jan 2021 06:28:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=nyCAT2Re; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405774AbhAZO0Y (ORCPT + 99 others); Tue, 26 Jan 2021 09:26:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392439AbhAZOYI (ORCPT ); Tue, 26 Jan 2021 09:24:08 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74FAC0611BD for ; Tue, 26 Jan 2021 06:23:25 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id a14so8645279edu.7 for ; Tue, 26 Jan 2021 06:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1czbBZLLxHwEsDj/a0a94VF0yBz3u23rkRDZfhlmeos=; b=nyCAT2ReufMhKUDlIx0rQQya1EhvNd3CAXYn6nE2QL4Vmc6395uy5mK+D+jGDLbH8z YBTHMXZ5OTYvLZQCey/ax2VfTRjckHrVObU3ETyQjToqgDfw4if7zzGcu1bFvjVsLdLT F4gzk6kKy+eZ2ZD6f+6CMfR+xgdho8L/8V2tlsFkR6eehlqnDN5KeIm2DzPp7oGr46TA I1QpUnH2hx6ubfWT7ZKBTQ13Ru+n+hkvKoz317kqYa32yGBC2jDOOm4nFn9neiUgZb6E n4mwe9IXjh/CKhqAes1aQMDcP5JYr8mrKYekaWRrWhxbJQXU9qlhVaUOoSQLVgeLluAG GjNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1czbBZLLxHwEsDj/a0a94VF0yBz3u23rkRDZfhlmeos=; b=dk7JmKqUwGdEG8VAEvyrWAbAnaZEZEioHYqInbN4r/B6fE8fKz7RV/6ya1QAZZ6Cd6 8SzocG9bGlkzwyCZd42T5EePCvBJs0CxcKXeAZ7+YhA00qEWOKt0C2xW3Uc89m1ROSpt L6al/ngHFskYz4dBnepZCOKo1dw/BiVwxn6O3+1urcFoEu4HzBXo6SzfbIEA1cZb3E9v 9rDN8qI+ICvE0q15zGvcBkNCmMO8Yt3tckR/Fh9unU1cOKxeyc+zSZwiXzk+mWEEeDqq EyLyrePo0sbxMlneQcxBzbfFuOJCHGSQRHRyftD7WTKS2SeeaE5NEdGFSl/ex1wO+DoT o2Cg== X-Gm-Message-State: AOAM531MBOdDoprcVmqDPOJAAUuu/3oUpCg4oirZ6ovQJPsJnwNdoWZY lJLlaXWy5xUsYtDuVNoJ07Bclv+zv2oYVNZ5LSNwdg== X-Received: by 2002:a05:6402:3508:: with SMTP id b8mr4815634edd.341.1611671004588; Tue, 26 Jan 2021 06:23:24 -0800 (PST) MIME-Version: 1.0 References: <20210125201156.1330164-1-pasha.tatashin@soleen.com> <20210125201156.1330164-2-pasha.tatashin@soleen.com> In-Reply-To: From: Pavel Tatashin Date: Tue, 26 Jan 2021 09:22:48 -0500 Message-ID: Subject: Re: [PATCH v3 1/1] loop: scale loop device by introducing per device lock To: Petr Vorel Cc: Tyler Hicks , Jens Axboe , linux-block@vger.kernel.org, LKML , Sasha Levin , James Morris , lukas.bulwahn@gmail.com, hch@lst.de, ming.lei@redhat.com, mzxreary@0pointer.de, mcgrof@kernel.org, zhengbin13@huawei.com, maco@android.com, Colin King , evgreen@chromium.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 4:24 AM Petr Vorel wrote: > > Hi, > > > Currently, loop device has only one global lock: > > loop_ctl_mutex. > > > This becomes hot in scenarios where many loop devices are used. > > > Scale it by introducing per-device lock: lo_mutex that protects the > > fields in struct loop_device. Keep loop_ctl_mutex to protect global > > data such as loop_index_idr, loop_lookup, loop_add. > > > Lock ordering: loop_ctl_mutex > lo_mutex. > > Reviewed-by: Petr Vorel Thank you for reviewing this patch. Pasha