From patchwork Sun Dec 2 16:46:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10708057 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 38CF113BF for ; Sun, 2 Dec 2018 16:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A02B2A85A for ; Sun, 2 Dec 2018 16:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D9BB2A862; Sun, 2 Dec 2018 16:47:58 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 BB9582A85A for ; Sun, 2 Dec 2018 16:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725601AbeLBQr7 (ORCPT ); Sun, 2 Dec 2018 11:47:59 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54664 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbeLBQr7 (ORCPT ); Sun, 2 Dec 2018 11:47:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PEIzcJpy3wmcq5f+eYMjlUOuE0CnlWkpzgmtT8oDRiY=; b=jzKgonlNm4P7S6tqoRuJcDZSD/ yIWlUwWhkznyIeNYzikFTH2LfN6/GVUgi8la1X/h2Sb2l1yTnXW97opI9zlZ8PNYu700+ljUo2rrf 0nNQnjjfr8+kakpVDxHJ5OhMC1V2wfeC+G3xW80j7fEfhm4TbdZdRgqfXH+VdplZa25rNCIjZ++5Q lQ1yKG3UqXQJWEgoPpj+iBhw9f+2Uz6SMKzNqNTILyKlVCyJzLzoDqJUyWsp54h5VL9xZn7GFNA7V URa9y3zh4veRPzeG0qztBUJlo1xN2QDOxBSy05LnjxZQ8esc+AwwJcItTUG7nMxwCxVb+rqnJkjX/ BN3h4jXg==; Received: from 089144206221.atnat0015.highway.bob.at ([89.144.206.221] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTUuN-0002Rg-BO; Sun, 02 Dec 2018 16:47:51 +0000 From: Christoph Hellwig To: Jens Axboe , Keith Busch , Sagi Grimberg Cc: Max Gurtovoy , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org Subject: [PATCH 04/13] nvme-pci: only allow polling with separate poll queues Date: Sun, 2 Dec 2018 17:46:19 +0100 Message-Id: <20181202164628.1116-5-hch@lst.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181202164628.1116-1-hch@lst.de> References: <20181202164628.1116-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 will allow us to simplify both the regular NVMe interrupt handler and the upcoming aio poll code. In addition to that the separate queues are generally a good idea for performance reasons. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg --- drivers/nvme/host/pci.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b820dd0351cb..d42bb76e5e78 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1089,13 +1089,6 @@ static int __nvme_poll(struct nvme_queue *nvmeq, unsigned int tag) } static int nvme_poll(struct blk_mq_hw_ctx *hctx) -{ - struct nvme_queue *nvmeq = hctx->driver_data; - - return __nvme_poll(nvmeq, -1); -} - -static int nvme_poll_noirq(struct blk_mq_hw_ctx *hctx) { struct nvme_queue *nvmeq = hctx->driver_data; u16 start, end; @@ -1605,12 +1598,11 @@ static const struct blk_mq_ops nvme_mq_admin_ops = { static const struct blk_mq_ops nvme_mq_ops = { NVME_SHARED_MQ_OPS, - .poll = nvme_poll, }; -static const struct blk_mq_ops nvme_mq_poll_noirq_ops = { +static const struct blk_mq_ops nvme_mq_poll_ops = { NVME_SHARED_MQ_OPS, - .poll = nvme_poll_noirq, + .poll = nvme_poll, }; static void nvme_dev_remove_admin(struct nvme_dev *dev) @@ -2298,10 +2290,10 @@ static int nvme_dev_add(struct nvme_dev *dev) int ret; if (!dev->ctrl.tagset) { - if (!dev->io_queues[HCTX_TYPE_POLL]) - dev->tagset.ops = &nvme_mq_ops; + if (dev->io_queues[HCTX_TYPE_POLL]) + dev->tagset.ops = &nvme_mq_poll_ops; else - dev->tagset.ops = &nvme_mq_poll_noirq_ops; + dev->tagset.ops = &nvme_mq_ops; dev->tagset.nr_hw_queues = dev->online_queues - 1; dev->tagset.nr_maps = HCTX_MAX_TYPES;