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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 0074EC2BA80 for ; Tue, 7 Apr 2020 02:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCAC0206C0 for ; Tue, 7 Apr 2020 02:14:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MxpcWNeb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726417AbgDGCO2 (ORCPT ); Mon, 6 Apr 2020 22:14:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23595 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726287AbgDGCO1 (ORCPT ); Mon, 6 Apr 2020 22:14:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586225667; 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=44SXGZt0xPbhcRSOYKE7iKipjDa+yIoa6ofEFx4YQKU=; b=MxpcWNebs6J+nFEIttxP1UE3I9bDm8b//vxwceR136ttkG4WlwGeAtviKCqaBk9iHwhg+9 NiUQHqtkmo1TVJcy/DDjRUJ3zQ/XUQxTsVHe4/xWO9zsakOLlV5QbZj9hfb/0Ht40P8/gX RBhyx60iFFhPSj93x4gYh9IqUfk62nE= 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-24-5WYMe6t2MHiYUIN2w1VJzA-1; Mon, 06 Apr 2020 22:14:23 -0400 X-MC-Unique: 5WYMe6t2MHiYUIN2w1VJzA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 958A5107ACCC; Tue, 7 Apr 2020 02:14:20 +0000 (UTC) Received: from localhost.localdomain (ovpn-8-35.pek2.redhat.com [10.72.8.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 191301001B28; Tue, 7 Apr 2020 02:14:08 +0000 (UTC) Date: Tue, 7 Apr 2020 10:14:03 +0800 From: Ming Lei To: Doug Anderson Cc: Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Paolo Valente , Salman Qazi , linux-block , linux-scsi@vger.kernel.org, Guenter Roeck , Ajay Joshi , Arnd Bergmann , Bart Van Assche , Chaitanya Kulkarni , Damien Le Moal , Hou Tao , Pavel Begunkov , Tejun Heo , LKML Subject: Re: [PATCH v2 2/2] blk-mq: Rerun dispatching in the case of budget contention Message-ID: <20200407021403.GB5779@localhost.localdomain> References: <20200402155130.8264-1-dianders@chromium.org> <20200402085050.v2.2.I28278ef8ea27afc0ec7e597752a6d4e58c16176f@changeid> <20200403013356.GA6987@ming.t460p> <20200405091446.GA3421@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Sun, Apr 05, 2020 at 09:26:39AM -0700, Doug Anderson wrote: > Hi, > > On Sun, Apr 5, 2020 at 2:15 AM Ming Lei wrote: > > > > @@ -103,6 +104,9 @@ static void blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx) > > rq = e->type->ops.dispatch_request(hctx); > > if (!rq) { > > blk_mq_put_dispatch_budget(hctx); > > + > > + if (e->type->ops.has_work && e->type->ops.has_work(hctx)) > > + blk_mq_delay_run_hw_queue(hctx, BLK_MQ_BUDGET_DELAY); > > To really close the race, don't we need to run all the queues > associated with the hctx? I haven't traced it through, but I've been > assuming that the multiple "hctx"s associated with the same queue will > have the same budget associated with them and thus they can block each > other out. Yeah, we should run all hctxs which share the same budget space. Also, in theory, we don't have to add the delay, however BFQ may plug the dispatch for 9 ms, so looks delay run queue is required. thanks, Ming