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: 10659751 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 098591751 for ; Mon, 29 Oct 2018 16:39:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4FB529BBB for ; Mon, 29 Oct 2018 16:39:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9CB029BC1; Mon, 29 Oct 2018 16:39:28 +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=unavailable 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 D22FF29BCA for ; Mon, 29 Oct 2018 16:39:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbeJ3B1I (ORCPT ); Mon, 29 Oct 2018 21:27:08 -0400 Received: from mail-it1-f176.google.com ([209.85.166.176]:51871 "EHLO mail-it1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbeJ3B1E (ORCPT ); Mon, 29 Oct 2018 21:27:04 -0400 Received: by mail-it1-f176.google.com with SMTP id y123-v6so4107374itc.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=ALWLVbKpMZzc87Yna8iUU5sg2w4Ht59EjKDAHEITu2CR8WN4/jznw0mJ6eghY293Jk jC340KDJ42qmhVsAEwAw7d16wE5yb5Ob1QuelDDMzPRbdO86D6jdDQ0jaDXqRgfKq957 38R/9s6IB/Pq/UkI7QC9iW8xn64yDXq5fTVQWt8zPWXiGMDcs4pVLH5vW1G3o6J4Q6B1 7tz3UrL9+figFJTfxrkKqONG7qnjIEC9/LV9SSDgVQ2/9XfSS4xiqCc29YweH1yIOGW9 3PcDzAhVYyUnZcsFvSzfYR3NdoeqSeUAfrihnmPmiTTgKbZxcGAmwFrImmo1IkwVZl+z wb0A== X-Gm-Message-State: AGRZ1gLGXQqbOdOcGgyeW67slDdVZT9M3zDns8z4f1aKZWKXe+TnU4ca Y3GIUKXtKHG916L2CVMWgOpA8w== 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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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(-)