From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sinan Kaya Subject: [PATCH] nvme: Acknowledge completion queue on each iteration Date: Mon, 17 Jul 2017 18:36:23 -0400 Message-ID: <1500330983-27501-1-git-send-email-okaya@codeaurora.org> Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:52100 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbdGQWgb (ORCPT ); Mon, 17 Jul 2017 18:36:31 -0400 Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: linux-nvme@lists.infradead.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-kernel@vger.kernel.org Code is moving the completion queue doorbell after processing all completed events and sending callbacks to the block layer on each iteration. This is causing a performance drop when a lot of jobs are queued towards the HW. Move the completion queue doorbell on each loop instead and allow new jobs to be queued by the HW. Signed-off-by: Sinan Kaya --- drivers/nvme/host/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d10d2f2..33d9b5b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -810,13 +810,12 @@ static void nvme_process_cq(struct nvme_queue *nvmeq) while (nvme_read_cqe(nvmeq, &cqe)) { nvme_handle_cqe(nvmeq, &cqe); + nvme_ring_cq_doorbell(nvmeq); consumed++; } - if (consumed) { - nvme_ring_cq_doorbell(nvmeq); + if (consumed) nvmeq->cqe_seen = 1; - } } static irqreturn_t nvme_irq(int irq, void *data) -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: okaya@codeaurora.org (Sinan Kaya) Date: Mon, 17 Jul 2017 18:36:23 -0400 Subject: [PATCH] nvme: Acknowledge completion queue on each iteration Message-ID: <1500330983-27501-1-git-send-email-okaya@codeaurora.org> Code is moving the completion queue doorbell after processing all completed events and sending callbacks to the block layer on each iteration. This is causing a performance drop when a lot of jobs are queued towards the HW. Move the completion queue doorbell on each loop instead and allow new jobs to be queued by the HW. Signed-off-by: Sinan Kaya --- drivers/nvme/host/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d10d2f2..33d9b5b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -810,13 +810,12 @@ static void nvme_process_cq(struct nvme_queue *nvmeq) while (nvme_read_cqe(nvmeq, &cqe)) { nvme_handle_cqe(nvmeq, &cqe); + nvme_ring_cq_doorbell(nvmeq); consumed++; } - if (consumed) { - nvme_ring_cq_doorbell(nvmeq); + if (consumed) nvmeq->cqe_seen = 1; - } } static irqreturn_t nvme_irq(int irq, void *data) -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: okaya@codeaurora.org (Sinan Kaya) Date: Mon, 17 Jul 2017 18:36:23 -0400 Subject: [PATCH] nvme: Acknowledge completion queue on each iteration Message-ID: <1500330983-27501-1-git-send-email-okaya@codeaurora.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Code is moving the completion queue doorbell after processing all completed events and sending callbacks to the block layer on each iteration. This is causing a performance drop when a lot of jobs are queued towards the HW. Move the completion queue doorbell on each loop instead and allow new jobs to be queued by the HW. Signed-off-by: Sinan Kaya --- drivers/nvme/host/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d10d2f2..33d9b5b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -810,13 +810,12 @@ static void nvme_process_cq(struct nvme_queue *nvmeq) while (nvme_read_cqe(nvmeq, &cqe)) { nvme_handle_cqe(nvmeq, &cqe); + nvme_ring_cq_doorbell(nvmeq); consumed++; } - if (consumed) { - nvme_ring_cq_doorbell(nvmeq); + if (consumed) nvmeq->cqe_seen = 1; - } } static irqreturn_t nvme_irq(int irq, void *data) -- 1.9.1