From patchwork Mon Oct 29 16:37:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10659687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9C861751 for ; Mon, 29 Oct 2018 16:37:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE0FC2967A for ; Mon, 29 Oct 2018 16:37:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C265629C46; Mon, 29 Oct 2018 16:37:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6088A2967A for ; Mon, 29 Oct 2018 16:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727694AbeJ3B1E (ORCPT ); Mon, 29 Oct 2018 21:27:04 -0400 Received: from mail-it1-f169.google.com ([209.85.166.169]:33998 "EHLO mail-it1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727845AbeJ3B1E (ORCPT ); Mon, 29 Oct 2018 21:27:04 -0400 Received: by mail-it1-f169.google.com with SMTP id e81-v6so10683518itc.1 for ; Mon, 29 Oct 2018 09:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=BdS9GbwNqTy4UUJTIRVyx9+xOos9PgHC/rUQ7NJVuWI=; b=LvBLHg5/oWRWhuYns8nWd0Gs53gQ8e73HtYRpe5kGUjIF251ynfkeQRFowo78rcAd8 R2xXSXAbqbnZ9yu6E33JJ+xLWs06mYsdAGfmfU6sgwIUjEin1rQsPxAAZou+Tqk3f1oj o8asYy+Wn6J58/LVrbeKonW39V5jdkI7VSnlpOj54m3iBpMbYZBm/ozS/x2Q6WLdgxgU 8xStnhFmMagtgZvVYxGVeZO5TgHzU1qJhlnbC+1k3QwbqgvNlPaI45dMwCsXtCITQHl3 PwQxIu0iMQIsSBV6Cc6u4cyAp0WbJCwWPQhw5D//7oxfMGlxbqfEa4beOzOi0Qn99ks1 yteg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=BdS9GbwNqTy4UUJTIRVyx9+xOos9PgHC/rUQ7NJVuWI=; b=axbJHPyuyRd07k84Z7SRZQqRv2mqZWyGSysdKXqRW1y3acUOgHR90sMbj90Dx7LZQ+ VrsnbmtKZWL/rNg5W9q8VWq4ybHgm8d36us8fXvQ/M8vXQHBomke1C4kZDpA3C2Qr+MW GDm3mV6pnuVTaUe/xqzt5pBUcHbinv0g3CS5lgMTQPZjq11MspxEL5bDi72eNApU+ts8 ac5S6rBr6eV2grV5r7PiRlRJ89anO3oNbbqb+LVE7lvH4sMwkGTiaJeaEcNegezDonTR ERH+a8CyJx0Z3QRB1aAvDAu/H2dkl6wM7hX65wD45uG9R1D5VE6n7dFeow6XwL83Rwcv 55TQ== X-Gm-Message-State: AGRZ1gIq8a3eLocyYPxQUZ8nfSxO6R2TxVBMk33wdUHDwiN4LyPviqFh NnEAj4lggLTbGOi7Syk2cSboqfEdYs0= X-Google-Smtp-Source: AJdET5cnJd58RLRTtNGRJVGeUaz4G3pRBbyH7I4ihQXkXiqVsORYYg4vh4yZ1H8f1vPKdQqlUtXGiw== X-Received: by 2002:a24:6c14:: with SMTP id w20-v6mr10219599itb.103.1540831062486; Mon, 29 Oct 2018 09:37:42 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id q15-v6sm3367019itc.38.2018.10.29.09.37.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 09:37:41 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCHSET v2 0/14] blk-mq: Add support for multiple queue maps Date: Mon, 29 Oct 2018 10:37:24 -0600 Message-Id: <20181029163738.10172-1-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series adds support for multiple queue maps for blk-mq. Since blk-mq was introduced, it's only support a single queue map. This means you can have 1 set of queues, and the mapping purely depends on what CPU an IO originated from. With this patch set, drivers can implement mappings that depend on both CPU and request type - and they can have multiple sets of mappings. NVMe is used as a proof of concept. It adds support for a separate write queue set. One way to use this would be to limit the number of write queues to favor reads, since NVMe does round-robin service of queues. An easy extension of this would be to add multiple sets of queues, for prioritized IO. NVMe also uses this feature to finally make the polling work efficiently, without triggering interrupts. This both increases performance (and decreases latency), at a lower system load. At the same time it's more flexible, as you don't have to worry about IRQ coalescing and redirection to avoid interrupts disturbing the workload. This is how polling should have worked from day 1. This is on top of the mq-conversions branch and series just posted. It can also be bound in my mq-maps branch. Changes since v1: - Ensure irq_calc_affinity_vectors() doesn't return more than 'maxvec' - Rebase on top of current mq-conversions series block/blk-flush.c | 7 +- block/blk-mq-cpumap.c | 19 +-- block/blk-mq-debugfs.c | 4 +- block/blk-mq-pci.c | 10 +- block/blk-mq-rdma.c | 4 +- block/blk-mq-sched.c | 18 ++- block/blk-mq-sysfs.c | 10 ++ block/blk-mq-tag.c | 5 +- block/blk-mq-virtio.c | 8 +- block/blk-mq.c | 213 ++++++++++++++++++++---------- block/blk-mq.h | 29 ++++- block/blk.h | 6 +- block/kyber-iosched.c | 6 +- drivers/block/virtio_blk.c | 2 +- drivers/nvme/host/pci.c | 238 ++++++++++++++++++++++++++++++---- drivers/scsi/qla2xxx/qla_os.c | 5 +- drivers/scsi/scsi_lib.c | 2 +- drivers/scsi/smartpqi/smartpqi_init.c | 3 +- drivers/scsi/virtio_scsi.c | 3 +- fs/block_dev.c | 2 + fs/direct-io.c | 2 + fs/iomap.c | 9 +- include/linux/blk-mq-pci.h | 4 +- include/linux/blk-mq-virtio.h | 4 +- include/linux/blk-mq.h | 24 +++- include/linux/blk_types.h | 4 +- include/linux/blkdev.h | 2 - include/linux/interrupt.h | 4 + kernel/irq/affinity.c | 40 ++++-- 29 files changed, 526 insertions(+), 161 deletions(-)