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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D627C43441 for ; Wed, 28 Nov 2018 01:49:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FCB2206B6 for ; Wed, 28 Nov 2018 01:49:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FCB2206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-block-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbeK1MtZ (ORCPT ); Wed, 28 Nov 2018 07:49:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12728 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbeK1MtZ (ORCPT ); Wed, 28 Nov 2018 07:49:25 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEC71300170C; Wed, 28 Nov 2018 01:49:34 +0000 (UTC) Received: from ming.t460p (ovpn-8-25.pek2.redhat.com [10.72.8.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73B9C60BE0; Wed, 28 Nov 2018 01:49:29 +0000 (UTC) Date: Wed, 28 Nov 2018 09:49:24 +0800 From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Subject: Re: [PATCH 7/8] blk-mq: use bd->last == true for list inserts Message-ID: <20181128014922.GE11128@ming.t460p> References: <20181126163556.5181-1-axboe@kernel.dk> <20181126163556.5181-8-axboe@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126163556.5181-8-axboe@kernel.dk> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 28 Nov 2018 01:49:35 +0000 (UTC) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Nov 26, 2018 at 09:35:55AM -0700, Jens Axboe wrote: > If we are issuing a list of requests, we know if we're at the last one. > If we fail issuing, ensure that we call ->commits_rqs() to flush any > potential previous requests. > > Signed-off-by: Jens Axboe > --- > block/blk-core.c | 2 +- > block/blk-mq.c | 32 ++++++++++++++++++++++++-------- > block/blk-mq.h | 2 +- > 3 files changed, 26 insertions(+), 10 deletions(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index c9758d185357..808a65d23f1a 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -1334,7 +1334,7 @@ blk_status_t blk_insert_cloned_request(struct request_queue *q, struct request * > * bypass a potential scheduler on the bottom device for > * insert. > */ > - return blk_mq_request_issue_directly(rq); > + return blk_mq_request_issue_directly(rq, true); > } > EXPORT_SYMBOL_GPL(blk_insert_cloned_request); > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 6a249bf6ed00..0a12cec0b426 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -1260,6 +1260,14 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, > if (!list_empty(list)) { > bool needs_restart; > > + /* > + * If we didn't flush the entire list, we could have told > + * the driver there was more coming, but that turned out to > + * be a lie. > + */ > + if (q->mq_ops->commit_rqs) > + q->mq_ops->commit_rqs(hctx); > + Looks you miss to do it for blk_mq_do_dispatch_sched() and blk_mq_do_dispatch_ctx(), in which only one request is added to the rq_list. Maybe we can call the .commit_rqs(hctx) just at the end of blk_mq_sched_dispatch_requests() for cover all non-direct-issue cases. Thanks, Ming