Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1162375ybb; Wed, 8 Apr 2020 18:16:05 -0700 (PDT) X-Google-Smtp-Source: APiQypJ+7FyZ6ToGLDzEwwXMzb75MY2Tja9Qz6YQmYwgV+tM47wkQGrbqPkvnPQo1ISAQrn2bIMo X-Received: by 2002:aca:a882:: with SMTP id r124mr2077801oie.53.1586394965383; Wed, 08 Apr 2020 18:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586394965; cv=none; d=google.com; s=arc-20160816; b=x6Ndsdb+RXS2Mk3pgnq8dCXfwci3VKiRmwT9wLd4cPPlmqvPUhzEVL7me2ASgks4Qb R1OcvrUVxmvU8E4YBoCZQdU5BhNYwGVaNKBydSuNXfBRmLUtnpX1qUROuSsgPYe/D7ur 7yvyibHWP25fJ1FR4XaHdREdKoFe1MviW3eCHGhDW65U7R5hkx/WZaAonwuKJDnbzgUY bjHIDLopEYGsIv+qgVEQDBy82bpkzvZvcVkDonLPTKakxIel3Uz0R6OAGS2hlvcjFbYY KfZXCxvUkpZlWh7ttujOTW8DVu/3t4yVsKQc18BZDweDiDGVQ99On3OTqTVyIw/OMXmS dyEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=r0cI23rv/CRPi00YuUefPu43DYEx/C8dlX+V/+YaZOc=; b=Yc+rX6NJ+ykLNVz7bZH2hYhCJZxTyukqSBB/ozEaEUjiXZJnOC1sYbUsfQdBC4wQs6 mOq8mTnF6p0HBs3uQlU7H6vdGXzZIEtbAm/EkE4fJePo+rlQQyGkRTMbC9CrBE2H9Lah x3X0ZGbT6vL7ZQsreovjqEi+BcIvrN10xSDISZKHFPbpZpST/K3JXLGHReFq0XON2aps 2mkD8e52RHGmDX0skn09+LB+INTP0jr6IaYXaMz1ln+WWFmG3kDAAp9It7up7Snm3mjU uzpPFBRoduYT+ABUoHOPZhEy/x/Y4C17H/RypOmQO8e0/DFI3mr9k8LWokXS10g8hwTx X8Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RNI22t0c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si2720174otd.116.2020.04.08.18.15.51; Wed, 08 Apr 2020 18:16:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RNI22t0c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbgDIBN0 (ORCPT + 99 others); Wed, 8 Apr 2020 21:13:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43420 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726536AbgDIBN0 (ORCPT ); Wed, 8 Apr 2020 21:13:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586394805; 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=r0cI23rv/CRPi00YuUefPu43DYEx/C8dlX+V/+YaZOc=; b=RNI22t0cIgBe+sU/YrYJVafxbmF9mvC8w6e6CG+qEv2bzj0CMUxuiKk9ItEOegP8ev3kM+ CCzb/TNn0q20ReBhuYz/CKBMuSE+YLT9V33U8hipXGBtyzj/Go7gIzHXKx5X3cJIBXgjXu 5aAH9ojeUF4jLabLikuScDBcxQa39JI= 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-87-XL7i7sUJOZCEc2DQIPo8NQ-1; Wed, 08 Apr 2020 21:13:20 -0400 X-MC-Unique: XL7i7sUJOZCEc2DQIPo8NQ-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 191C218AB2CF; Thu, 9 Apr 2020 01:13:17 +0000 (UTC) Received: from localhost.localdomain (ovpn-8-27.pek2.redhat.com [10.72.8.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 102B952735; Thu, 9 Apr 2020 01:13:05 +0000 (UTC) Date: Thu, 9 Apr 2020 09:13:01 +0800 From: Ming Lei To: Douglas Anderson Cc: axboe@kernel.dk, jejb@linux.ibm.com, martin.petersen@oracle.com, paolo.valente@linaro.org, groeck@chromium.org, Gwendal Grignou , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, sqazi@google.com, =?iso-8859-1?Q?Andr=E9?= Almeida , Bart Van Assche , Damien Le Moal , John Garry , Pavel Begunkov , Sagi Grimberg , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/4] blk-mq: Add blk_mq_delay_run_hw_queues() API call Message-ID: <20200409011301.GA369792@localhost.localdomain> References: <20200408150402.21208-1-dianders@chromium.org> <20200408080255.v4.2.I4c665d70212a5b33e103fec4d5019a59b4c05577@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200408080255.v4.2.I4c665d70212a5b33e103fec4d5019a59b4c05577@changeid> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 08, 2020 at 08:04:00AM -0700, Douglas Anderson wrote: > We have: > * blk_mq_run_hw_queue() > * blk_mq_delay_run_hw_queue() > * blk_mq_run_hw_queues() > > ...but not blk_mq_delay_run_hw_queues(), presumably because nobody > needed it before now. Since we need it for a later patch in this > series, add it. > > Signed-off-by: Douglas Anderson > --- > > Changes in v4: None > Changes in v3: > - ("blk-mq: Add blk_mq_delay_run_hw_queues() API call") new for v3 > > Changes in v2: None > > block/blk-mq.c | 19 +++++++++++++++++++ > include/linux/blk-mq.h | 1 + > 2 files changed, 20 insertions(+) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 2cd8d2b49ff4..ea0cd970a3ff 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -1537,6 +1537,25 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async) > } > EXPORT_SYMBOL(blk_mq_run_hw_queues); > > +/** > + * blk_mq_delay_run_hw_queues - Run all hardware queues asynchronously. > + * @q: Pointer to the request queue to run. > + * @msecs: Microseconds of delay to wait before running the queues. > + */ > +void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs) > +{ > + struct blk_mq_hw_ctx *hctx; > + int i; > + > + queue_for_each_hw_ctx(q, hctx, i) { > + if (blk_mq_hctx_stopped(hctx)) > + continue; > + > + blk_mq_delay_run_hw_queue(hctx, msecs); > + } > +} > +EXPORT_SYMBOL(blk_mq_delay_run_hw_queues); > + > /** > * blk_mq_queue_stopped() - check whether one or more hctxs have been stopped > * @q: request queue. > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > index 11cfd6470b1a..405f8c196517 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -503,6 +503,7 @@ void blk_mq_unquiesce_queue(struct request_queue *q); > void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs); > void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async); > void blk_mq_run_hw_queues(struct request_queue *q, bool async); > +void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs); > void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset, > busy_tag_iter_fn *fn, void *priv); > void blk_mq_tagset_wait_completed_request(struct blk_mq_tag_set *tagset); > -- > 2.26.0.292.g33ef6b2f38-goog > Reviewed-by: Ming Lei -- Ming