Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp990752ybl; Thu, 23 Jan 2020 11:27:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxy5N0JsrRuM9LTGcDPpaeR2du+oM4lVo8r2bhEF1JJtV1hp+foYmRG7mDZ0F0UXJU4AzAc X-Received: by 2002:a05:6830:128e:: with SMTP id z14mr12467659otp.184.1579807638985; Thu, 23 Jan 2020 11:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579807638; cv=none; d=google.com; s=arc-20160816; b=NmhCEdW9S8D6FJtvgpdsqiyg5EV0ASzDRuJNeQWr2ROl094hTi7yY9/ZwVWiCn16DR qtz1yYooV+diz/tddIZI9/i30VLm01+tCErcllEhRQ7RiTpgnW4e1VRwKw74BQfz2ELf IpOk5HySjzw4P74Cd6BKH8GASbmIgaLsisR12pIMGV1G1Z9pS0jhAiv0NATIjgARteI1 FoxaqtC6TaPPTqLx1WkBErRcJ84kZcWdhiMKXZ06AnfEgnHod+LDUQ/8MYuMhfh7ntPC DHFLgpqq56lLnJXndGA3KQXRpdAscujFm6kxNdfXBl+Fx/llOyu1zhWYTNjgl7g9hHtG TxfQ== 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:dkim-signature; bh=AqIW6P3nd0U6+Dsb/HPJR6jYzvPosfZF53uQ6BthKN4=; b=IzFuOuZDABN0po8YCtDCXruBnXMC0GyFlemgIr8mAn6j2grdOB2P+5ykVyY5x9pn65 HUt2MNuMTl+LeBImSx2PBMLTB8tqfHgMcBiZYRzJPjUYEnAkhG0KkaXOMvskhDg0vz/I HlsLG1ns3DyzQqKf0h0S6MKAyt3u6rkd07audTUXMMO8eJtE51L2c+5Vvyn6BpIVzKwG UmIIuUnOoYvxPlFQYTkFYoarl+3C89bdbDEgX6ydE6mp+45JjhhAtqSkoXSRFPhxN5el /UPo6h/Ega70pyqzGJJFEORKkX9kh7MIJNHaMyUxqdK9MEDO9piH+nYFyEU1LJVQQI3Y JA9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rubrik.com header.s=google header.b="gW3y/RVj"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=rubrik.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si1259410oic.205.2020.01.23.11.27.06; Thu, 23 Jan 2020 11:27:18 -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=@rubrik.com header.s=google header.b="gW3y/RVj"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=rubrik.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728992AbgAWT0J (ORCPT + 99 others); Thu, 23 Jan 2020 14:26:09 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39084 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728900AbgAWT0J (ORCPT ); Thu, 23 Jan 2020 14:26:09 -0500 Received: by mail-ed1-f68.google.com with SMTP id t17so4503341eds.6 for ; Thu, 23 Jan 2020 11:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rubrik.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AqIW6P3nd0U6+Dsb/HPJR6jYzvPosfZF53uQ6BthKN4=; b=gW3y/RVj2biVs5qjZRGGCVdyKyYY5PkgEb4/NzAl2uLh5e5wBRP2O/SVVaH2DzteAs QGluUfOAUEKlrymgGFQgmLZH3RPKauzPaxKKz6mgDyIWqG8c63VnJgBPMmYcPZQFti+3 lH/P4AQhTWU3tEZbuNDs/vGZNtzVd/ySMEEjo= 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=AqIW6P3nd0U6+Dsb/HPJR6jYzvPosfZF53uQ6BthKN4=; b=noraJgGiNZEhyHTJJHzjiaaM5B7TzJjH/7FMQA56DWcjqtf67EUPM7JKVfcW41G/BC 3AJOtTX/cjaQysD9y4HjkCr+qn8Q5fDAjJfCTu5FW1sfs7f2kJ6cddgKbwn/TtE1fK4F 425UgF1LhxjNeef9Hm+UmNvurD4zRJJ6bapv46tJnFNg3iYGkDukpOwj8Ty28OLdKXqL mP/LDSyr6rNMo1yrYqiKK9wMfCs6soUCumNqDBVUiJyWB3GGA4dDRCDVxUJBbcW1nZJg 1qQfEDFMDZP4DlwJwq2BZq/U6Oop5SdFhlwCVjPRWCl2JgzDPN8u+SVUSl6tQV2rOroO 84Ng== X-Gm-Message-State: APjAAAWaMwGLOMzVtnEaFBdS2b9tdeIP+SKvWxHwwuG//RctIMbfw3tt 5ndTxI7YHid9ERNXnlFqd+5/nP6cVQxMm3jWpyXNR3I1IQ== X-Received: by 2002:a50:bae1:: with SMTP id x88mr8266708ede.10.1579807568083; Thu, 23 Jan 2020 11:26:08 -0800 (PST) MIME-Version: 1.0 References: <20200121192540.51642-1-muraliraja.muniraju@rubrik.com> <88d16046-f9aa-d5e8-1b1c-7c3ff9516290@kernel.dk> In-Reply-To: <88d16046-f9aa-d5e8-1b1c-7c3ff9516290@kernel.dk> From: Muraliraja Muniraju Date: Thu, 23 Jan 2020 11:25:57 -0800 Message-ID: Subject: Re: [PATCH] Adding multiple workers to the loop device. To: Jens Axboe Cc: linux-block , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I see that the kernel is already is using the multi queues with the number of hardware queues is 1. But the problem IMO is that the worker seems to be processing 1 request at a time, to parallelize requests and have more concurrency more workers needs to be added. I also tried increasing the nr_hw_queues without increasing the number of workers, I did not see any difference in performance and it stayed the same. It allows to queue more requests but it is processed one at a time. I have not tried with enabling BLK_MQ_F_BLOCKING though. I see that it can schedule requests early. On Thu, Jan 23, 2020 at 10:59 AM Jens Axboe wrote: > > 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 >