From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D60EC433F5 for ; Wed, 17 Nov 2021 08:21:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12C0E61BF4 for ; Wed, 17 Nov 2021 08:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230088AbhKQIX5 (ORCPT ); Wed, 17 Nov 2021 03:23:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33461 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbhKQIX4 (ORCPT ); Wed, 17 Nov 2021 03:23:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637137257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OoEfUGUZUzgEZ5dAHO0PBW6/WOrKnYEUVVLpFauWtgw=; b=hByRDG+Wn/uNVX37lEmM5HJLnmlAcJfR57Ck6QuLQeRdUMPo/NbkGKt8a7+56Pe/LvD1ej hIwrqEa4IQXZeFPHBxJdAAHNdojhBZnKICAVinxwzQs7fR60ey/ipOcbcbBWIBAno+/ADt +CQh0Fa2/FnHvhNma3ajpwAj/qGuxRE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576--nukefuyP9SP35Zpin5H-g-1; Wed, 17 Nov 2021 03:20:56 -0500 X-MC-Unique: -nukefuyP9SP35Zpin5H-g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B5D381901B; Wed, 17 Nov 2021 08:20:51 +0000 (UTC) Received: from T590 (ovpn-8-24.pek2.redhat.com [10.72.8.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 126D760D30; Wed, 17 Nov 2021 08:20:48 +0000 (UTC) Date: Wed, 17 Nov 2021 16:20:44 +0800 From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, hch@infradead.org Subject: Re: [PATCH 1/4] block: add mq_ops->queue_rqs hook Message-ID: References: <20211117033807.185715-1-axboe@kernel.dk> <20211117033807.185715-2-axboe@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211117033807.185715-2-axboe@kernel.dk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Tue, Nov 16, 2021 at 08:38:04PM -0700, Jens Axboe wrote: > If we have a list of requests in our plug list, send it to the driver in > one go, if possible. The driver must set mq_ops->queue_rqs() to support > this, if not the usual one-by-one path is used. > > Signed-off-by: Jens Axboe > --- > block/blk-mq.c | 17 +++++++++++++++++ > include/linux/blk-mq.h | 8 ++++++++ > 2 files changed, 25 insertions(+) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 9b4e79e2ac1e..005715206b16 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -2208,6 +2208,19 @@ static void blk_mq_plug_issue_direct(struct blk_plug *plug, bool from_schedule) > int queued = 0; > int errors = 0; > > + /* > + * Peek first request and see if we have a ->queue_rqs() hook. If we > + * do, we can dispatch the whole plug list in one go. We already know > + * at this point that all requests belong to the same queue, caller > + * must ensure that's the case. > + */ > + rq = rq_list_peek(&plug->mq_list); > + if (rq->q->mq_ops->queue_rqs) { > + rq->q->mq_ops->queue_rqs(&plug->mq_list); > + if (rq_list_empty(plug->mq_list)) > + return; > + } > + Then BLK_MQ_F_TAG_QUEUE_SHARED isn't handled as before for multiple NVMe NS. thanks, Ming