From patchwork Thu Mar 9 13:16:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9613387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 04B0460524 for ; Thu, 9 Mar 2017 13:42:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7269284FA for ; Thu, 9 Mar 2017 13:42:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC0DC2857E; Thu, 9 Mar 2017 13:42:10 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 80844285C2 for ; Thu, 9 Mar 2017 13:42:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753690AbdCINmA (ORCPT ); Thu, 9 Mar 2017 08:42:00 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:47695 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754646AbdCINl4 (ORCPT ); Thu, 9 Mar 2017 08:41:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding: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=UwSOs11TAQ/yJtwuNARhT7navd++1rN9ugUIvQlAeAA=; b=nnT0fpB4QhOQjUr5c4EDnQfDE CphUBtIRTHSBG6h1t4ClAnmcYMx7vAatwGTiRvcFTwgG+IB4FgMOrykYHv2GwjOVMQfmaX2wd+Aps c2UxRjGNGNJ70Gjac+u9RfFhwuPo3VN4TWt6ff1mJssiYEIjdRQR0VWhOeno4IIlal4Lb7gW4/2ga wR/Em1RGfh0BPYxyPq2enynYNTxp2Ue1EReqOsJu80ut2Wuh6URQFlrEaj/nmqIMIB3QNMVn+PxNI ESkP1qKdNh37Vr6YOQF9qEIX2vG6js93gG5AWbR1Cb2Z3TUcRnqju3tYEUs+q1cjWI5KwlMX4lus9 QvQ5MutjA==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1clxwm-0001My-96; Thu, 09 Mar 2017 13:17:37 +0000 From: Sagi Grimberg To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH rfc 09/10] nvmet: Use non-selective polling Date: Thu, 9 Mar 2017 15:16:41 +0200 Message-Id: <1489065402-14757-10-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489065402-14757-1-git-send-email-sagi@grimberg.me> References: <1489065402-14757-1-git-send-email-sagi@grimberg.me> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It doesn't really make sense to do selective polling because we never care about specific IOs. Non selective polling can actually help by doing some useful work while we're submitting a command. We ask for a batch of (magic) 4 completions which looks like a decent network<->backend proportion, if less are available we'll see less. Signed-off-by: Sagi Grimberg --- drivers/nvme/target/io-cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c index 4195115c7e54..8e4fd7ca4a8a 100644 --- a/drivers/nvme/target/io-cmd.c +++ b/drivers/nvme/target/io-cmd.c @@ -46,7 +46,6 @@ static void nvmet_execute_rw(struct nvmet_req *req) struct scatterlist *sg; struct bio *bio; sector_t sector; - blk_qc_t cookie; int op, op_flags = 0, i; if (!req->sg_cnt) { @@ -85,16 +84,17 @@ static void nvmet_execute_rw(struct nvmet_req *req) bio_set_op_attrs(bio, op, op_flags); bio_chain(bio, prev); - cookie = submit_bio(prev); + submit_bio(prev); } sector += sg->length >> 9; sg_cnt--; } - cookie = submit_bio(bio); + submit_bio(bio); - blk_mq_poll(bdev_get_queue(req->ns->bdev), cookie); + /* magic 4 is what we are willing to grab before we return */ + blk_mq_poll_batch(bdev_get_queue(req->ns->bdev), 4); } static void nvmet_execute_flush(struct nvmet_req *req)