From patchwork Thu Aug 24 14:43:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13364311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BECAC71153 for ; Thu, 24 Aug 2023 14:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241731AbjHXOpb (ORCPT ); Thu, 24 Aug 2023 10:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236907AbjHXOpI (ORCPT ); Thu, 24 Aug 2023 10:45:08 -0400 Received: from out-1.mta1.migadu.com (out-1.mta1.migadu.com [95.215.58.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FCBC1BC5 for ; Thu, 24 Aug 2023 07:45:05 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1692888302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=S9+qnTir0RgMRooesWbZgHu9XmCpC66Spzkbub/tPAs=; b=Tv8yFGBlN3FnIqVaaR7vwYZENCXOSfMeywy9FLLHKGN4V/I1K3NO4AGXmsqjBLwkZsePsK qSlHpRlehWg/95fHe+r+CqJD0fD2Vdw14UGWbcPrY8OBPNnuALnS7XmidBNRluc0RGHvyM E8ClSDm0xeJgUrF8n7jHGwVyD6GcdJo= From: chengming.zhou@linux.dev To: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com, bvanassche@acm.org, kbusch@kernel.org Cc: mst@redhat.com, sagi@grimberg.me, damien.lemoal@opensource.wdc.com, kch@nvidia.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: [PATCH 0/6] blk-mq: optimize the queue_rqs() support Date: Thu, 24 Aug 2023 22:43:57 +0800 Message-ID: <20230824144403.2135739-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Chengming Zhou The current queue_rqs() support has limitation that it can't work on shared tags queue, which is resolved by patch 1-3. We move the account of active requests to where we really allocate the driver tag. This is clearer and matched with the unaccount side which now happen when we put the driver tag. And we can remove RQF_MQ_INFLIGHT, which was used to avoid double account problem of flush request. Another problem is that the driver that support queue_rqs() has to set inflight request table by itself, which is resolved in patch 4. The patch 5 fixes a potential race problem which may cause false timeout because of the reorder of rq->state and rq->deadline. The patch 6 add support queue_rqs() for null_blk, which showed a 3.6% IOPS improvement in fio/t/io_uring benchmark on my test VM. And we also use it for testing queue_rqs() on shared tags queue. Thanks for review! Chengming Zhou (6): blk-mq: account active requests when get driver tag blk-mq: remove RQF_MQ_INFLIGHT blk-mq: support batched queue_rqs() on shared tags queue blk-mq: update driver tags request table when start request blk-mq: fix potential reorder of request state and deadline block/null_blk: add queue_rqs() support block/blk-flush.c | 11 ++----- block/blk-mq-debugfs.c | 1 - block/blk-mq.c | 53 ++++++++++++++------------------ block/blk-mq.h | 57 ++++++++++++++++++++++++----------- drivers/block/null_blk/main.c | 20 ++++++++++++ drivers/block/virtio_blk.c | 2 -- drivers/nvme/host/pci.c | 1 - include/linux/blk-mq.h | 2 -- 8 files changed, 84 insertions(+), 63 deletions(-)