Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp965193ybl; Thu, 23 Jan 2020 11:00:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyDY5XUUDA4BDfHu+Rz88oSYRgTRFyJugXZFgZnosTh750jiTwXkjwrkJtt1V8WM4REQMP6 X-Received: by 2002:a9d:760e:: with SMTP id k14mr8794327otl.344.1579806023453; Thu, 23 Jan 2020 11:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579806023; cv=none; d=google.com; s=arc-20160816; b=Sbw1B5y5QCHq59J+XmtNZ09c3wtDwCj+6T5IlwjkctCuHmswAF4INF34IJ5qBnVrq3 egBRmzerN/QDvU+v/QtbZRqdWUsteEeQG26imdy6MPAH1DS0hkdLnAQ4Zr5dP3ugXdXL D252qTUhg/bRZ+xCF7isFYmRvBDgwBqikL0SsmGzPlKor9J6djfVKz8d1oZYx5c4Ckzf 2OgApHuhGHOlISNqfNueZMpxA70zPddGZUvcUc23We0fa7iaf8quaYg9lyZi8i6d4hm3 IeEYr/w4li/NQE2zjuxy8hPmaMsNXEMDfWE9Tvoz+FDyZi9PRyom5gDnRpfJ1Sh3GXOl s6yg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=hAqWpJ1NuJTGK5OF4DpdL8tVTeFlEZehO0INBb+L18s=; b=y3B6e6GFruO+0t59QUAR2tDNIGda6B59AkFLFcqerUNb15l/ZX5xjyWbvilEAqeELK puaU+nmy95Y/aLaSs3BE+OvSUKGNVaWRWD+WNJnpLwM2UYTaiXhQ2gtYZeopVNDm24un RpwOVoWkKBgDsWq6JxYkChYvfjRpBsw+D+hlgph8CmAaa3nwrmv8NwzM+LlY9xMVf+Kq 1JD/I9FvMdBmfm+S61qp5k3nlcv+XD11iOb/B2ZQqlsqvFCTB84xESTbadrZW0MhH0gu tEYigF4ivo3wSzwNKXVnBMRylEO+1/fbHUaTg7ubf88EkyWSga+RkRH+nBw6+J/zKOvV VP8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=M9Vgqe1f; 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 o83si1251396oib.44.2020.01.23.11.00.10; Thu, 23 Jan 2020 11:00:23 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=M9Vgqe1f; 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 S1728827AbgAWS7N (ORCPT + 99 others); Thu, 23 Jan 2020 13:59:13 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40085 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727590AbgAWS7N (ORCPT ); Thu, 23 Jan 2020 13:59:13 -0500 Received: by mail-pl1-f194.google.com with SMTP id s21so1728464plr.7 for ; Thu, 23 Jan 2020 10:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hAqWpJ1NuJTGK5OF4DpdL8tVTeFlEZehO0INBb+L18s=; b=M9Vgqe1fI4i1vkrxFL94iqUTtEMBkNNpQs1Jzc7292AqRfj9q/5vvSUaw2jVl5Ghyz tTJrd0Ilejp/eyhwIfFLkzi5V2FBdZgW5PMuUSJ8jSuzgZ1TeO0yenU8WQJqhe3+mKHz t0XknWPJgsX/ni67qERPzuVT0b7IABVBticzPrv/0X2ZrdPrD3gFfRWrXCuFjlHjjg6F URB+1y9Q4a+zaR+1DX9f0oM3BMINDMhZFuN2+WT3zurC4b3cYpvkz2SdXueZNvTulPTf ZN4uwHr3mbX3gAfsFyjfFnK5bDIiPmAEKlcSdpXVCfw6Qrts/CICt4bYicizXTmrFKch O6YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hAqWpJ1NuJTGK5OF4DpdL8tVTeFlEZehO0INBb+L18s=; b=FmVc8mwJ9YEkgGycr3WonrTp/3+lM3gSpoXFZWhLD6xpokezKnO/M2GTfJvlNQdCF1 zBU4F0NTRUoTfeZcySzylAiwK14RgIfbLG9FdS5BxjnKC+TVD+wF4gNzGDxsWQ3GMnnv sZ92IMry6WTxzr3xeWAXGOGh+Rn3FaW9NvYjlNi9yYk3MTFBxRfy4sqFKXB9CW335zTG 5QtjoESzfyP1fQpVBNru7EG/Ncsk7GeWeSedvAVdEy+ZCNAQkNDinX/ikArkPOIIBt4F Xcg8GedzJIbv/W4zD4nnn3DD3Ij6SD2Ys5rLaxVq84TTEsVq2j50HB41pdIzlhBrnr+p hVjg== X-Gm-Message-State: APjAAAUSX7JFgatE5dmo4N5glwzaQu9bPg3t8Tq447IjxzI+cMhWBn6q WL78qfJipoStwyxY6TuY2OzfNQSyOpBIfw== X-Received: by 2002:a17:902:59cd:: with SMTP id d13mr17953917plj.146.1579805952557; Thu, 23 Jan 2020 10:59:12 -0800 (PST) Received: from ?IPv6:2600:380:4562:fb25:b980:6664:b71f:35b5? ([2600:380:4562:fb25:b980:6664:b71f:35b5]) by smtp.gmail.com with ESMTPSA id v4sm4123577pgo.63.2020.01.23.10.59.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2020 10:59:12 -0800 (PST) Subject: Re: [PATCH] Adding multiple workers to the loop device. To: "muraliraja.muniraju" Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200121192540.51642-1-muraliraja.muniraju@rubrik.com> From: Jens Axboe Message-ID: <88d16046-f9aa-d5e8-1b1c-7c3ff9516290@kernel.dk> Date: Thu, 23 Jan 2020 11:59:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200121192540.51642-1-muraliraja.muniraju@rubrik.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/21/20 12:25 PM, muraliraja.muniraju wrote: > Current loop device implementation has a single kthread worker and > drains one request at a time to completion. If the underneath device is > slow then this reduces the concurrency significantly. To help in these > cases, adding multiple loop workers increases the concurrency. Also to > retain the old behaviour the default number of loop workers is 1 and can > be tuned via the ioctl. Have you considered using blk-mq for this? Right now loop just does some basic checks and then queues for a thread. If you bump nr_hw_queues up (provide a parameter for that) and set BLK_MQ_F_BLOCKING in the tag flags, then that might be a more viable approach for handling this. -- Jens Axboe