From patchwork Fri Jan 19 15:20:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10175571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2590B60392 for ; Fri, 19 Jan 2018 15:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BE4A286CD for ; Fri, 19 Jan 2018 15:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10395286DA; Fri, 19 Jan 2018 15:20:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55E4E286C4 for ; Fri, 19 Jan 2018 15:20:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932191AbeASPUT (ORCPT ); Fri, 19 Jan 2018 10:20:19 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:17704 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755866AbeASPUS (ORCPT ); Fri, 19 Jan 2018 10:20:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1516375219; x=1547911219; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=yWv19su0gqldnr0jjDRMJxcJc/K9GqPrjqBry8zGKjs=; b=GCCl1H8V1bbhLRB+K7K+Wkk92Vs5TxUo2SFVueJQm7tMTLZZoSJELNwT Zs73zmo+QvbVOXjJ/LZtCCSI2jsdMFe/Q6HIxjDnLg9SZNhFzQ0kM/8R5 i5eJLjWtioVLxVTCCnfljw1GtRPFJBhDEv/VkF2D404sEW6xcAkISqgVa HMFwe06pD4BpSs7vYBR20AqO3IbxfmCc9xY/nSBkXSX1bvRFST8bYQxdk k6y5hkY56CFckQazEef07/34r4saW7f1oFSoEDRjmLOlEVJ4XqoysG2vV dtbvKhdphcfy3rLjH1sdeOFh4ODe8cVqBMN8ZUhrneOrzpF8ym2BomM+w g==; X-IronPort-AV: E=Sophos;i="5.46,381,1511798400"; d="scan'208";a="69949509" Received: from mail-sn1nam02lp0024.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.24]) by ob1.hgst.iphmx.com with ESMTP; 19 Jan 2018 23:20:17 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yWv19su0gqldnr0jjDRMJxcJc/K9GqPrjqBry8zGKjs=; b=N+UpRBDTFs0lFslv0MbdwUv2UK/Vayipi2ZN3IiUFX7MPFBpOcS7sjEBVD1ePaJ/TGkRn6vNgyELmVY/e3MAl+Sx2skGdheiHu3TS2NtazYQYjtaE2KfAEIzHmbCNVJaQKW8nCvIzrs2ZafIcvexrf6u7j9DbBByTVIdpemWR2A= Received: from CY1PR0401MB1536.namprd04.prod.outlook.com (10.163.19.154) by CY1PR0401MB1114.namprd04.prod.outlook.com (10.160.161.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 19 Jan 2018 15:20:14 +0000 Received: from CY1PR0401MB1536.namprd04.prod.outlook.com ([10.163.19.154]) by CY1PR0401MB1536.namprd04.prod.outlook.com ([10.163.19.154]) with mapi id 15.20.0428.014; Fri, 19 Jan 2018 15:20:13 +0000 From: Bart Van Assche To: "ming.lei@redhat.com" , "axboe@kernel.dk" CC: "dm-devel@redhat.com" , "hch@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "osandov@fb.com" , "snitzer@redhat.com" Subject: Re: [RFC PATCH] blk-mq: fixup RESTART when queue becomes idle Thread-Topic: [RFC PATCH] blk-mq: fixup RESTART when queue becomes idle Thread-Index: AQHTkAXlp7DN5JBZKUeyLfttG5XpOaN52OmAgAADroCAAATDAIAAE3uAgAAE1gCAABc0gIAAaoKAgAAZS4CAADjnAIAAhGAA Date: Fri, 19 Jan 2018 15:20:13 +0000 Message-ID: <1516375212.3190.4.camel@wdc.com> References: <20180118024124.8079-1-ming.lei@redhat.com> <20180118170353.GB19734@redhat.com> <1516296056.2676.23.camel@wdc.com> <20180118183039.GA20121@redhat.com> <1516301278.2676.35.camel@wdc.com> <20180119023212.GA25413@ming.t460p> <20180119072623.GB25369@ming.t460p> In-Reply-To: <20180119072623.GB25369@ming.t460p> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; x-originating-ip: [76.126.112.182] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR0401MB1114; 7:ZJFdufYkecU73VW/sfDvHEH9zKU44A4t3a2JCOWEI+6h9SznPFDNIwdLHMHvSaY7aIeQbv+I+p3J8SEx8CGnKT4zsX6wiMVFmUY0/z9Foi6m0WlfUaJfLtJnG0Ewp7JwKu3vsg5g8q2uOImvzUCQbt7Vrre9POUJ0nVIZ/mEM2mkzKYkJFTXjZs7COggiHuF1sTBykZhdjfQUXd30yx4yZyCd+115ssCg7MHsOOQRt3UwiyKEgKDABnwkrCv+YeQ; 20:hlk8WckGrHAXsZ02rlTsuavEE0U555SHRfWzWCN+qfCSXLh9X8vKDmdpDv7ugPuNCxZpIJ/kaTP5eXk1t9P3ytifyPYY7RymALnWuprY3B/FM9ZcPodMgHuE0tEYzjY7waY0VFM6qTLrZM5aXfcMYGTmHtfoXex2w9KKW54D6Qc= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 6cf4dc82-3b11-4e3d-b6f9-08d55f502377 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060)(7193020); SRVR:CY1PR0401MB1114; x-ms-traffictypediagnostic: CY1PR0401MB1114: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231023)(2400079)(944501161)(6055026)(6041268)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR0401MB1114; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR0401MB1114; x-forefront-prvs: 0557CBAD84 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39380400002)(39860400002)(376002)(346002)(189003)(199004)(377424004)(25786009)(103116003)(66066001)(6506007)(3846002)(8936002)(6116002)(6246003)(93886005)(4326008)(76176011)(2906002)(14454004)(316002)(8676002)(102836004)(110136005)(81166006)(7736002)(305945005)(81156014)(478600001)(5660300001)(72206003)(54906003)(77096007)(6436002)(36756003)(2501003)(99286004)(106356001)(6486002)(6512007)(105586002)(53936002)(2950100002)(86362001)(3280700002)(97736004)(2900100001)(3660700001)(229853002)(68736007)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0401MB1114; H:CY1PR0401MB1536.namprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-microsoft-antispam-message-info: H8+NFsCawYcmiJ0ZQ7Yu2DH1WUcM27bBABj2f2SnmpN/IZE7tyAsg+mqrRDtZgyfC03HK4EcSVkqi3DcMMF7OQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cf4dc82-3b11-4e3d-b6f9-08d55f502377 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2018 15:20:13.8613 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1114 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 2018-01-19 at 15:26 +0800, Ming Lei wrote: > Please see queue_delayed_work_on(), hctx->run_work is shared by all > scheduling, once blk_mq_delay_run_hw_queue(100ms) returns, no new > scheduling can make progress during the 100ms. How about addressing that as follows: Bart. diff --git a/block/blk-mq.c b/block/blk-mq.c index f7515dd95a36..57f8379a476d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1403,9 +1403,9 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async, put_cpu(); } - kblockd_schedule_delayed_work_on(blk_mq_hctx_next_cpu(hctx), - &hctx->run_work, - msecs_to_jiffies(msecs)); + kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), + &hctx->run_work, + msecs_to_jiffies(msecs)); } void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs)