Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934057AbdDFAc2 (ORCPT ); Wed, 5 Apr 2017 20:32:28 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:62328 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933226AbdDFAcU (ORCPT ); Wed, 5 Apr 2017 20:32:20 -0400 X-IronPort-AV: E=Sophos;i="5.37,281,1488816000"; d="scan'208";a="110869040" From: Bart Van Assche To: "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "longli@exchange.microsoft.com" , "axboe@kernel.dk" CC: "sthemmin@microsoft.com" , "kys@microsoft.com" , "longli@microsoft.com" Subject: Re: [PATCH] block-mq: set both block queue and hardware queue restart bit for restart Thread-Topic: [PATCH] block-mq: set both block queue and hardware queue restart bit for restart Thread-Index: AQHSrmzSSZ/m2CRLtUe7E7wgCa1JMaG3faCA Date: Thu, 6 Apr 2017 00:32:16 +0000 Message-ID: <1491438735.2787.18.camel@sandisk.com> References: <1491437781-3565-1-git-send-email-longli@exchange.microsoft.com> In-Reply-To: <1491437781-3565-1-git-send-email-longli@exchange.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=sandisk.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [63.163.107.100] x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1534;7:yqTmY2gc1TTzB+peDsA6d9RoS8cohMZ52lUqdx3tasNax4z/3VpnvnOM7dwti7ygyzEF2Iya6aO3vAjvN4bjOq7KY0A/8fic9FbokjMUqhxDfVx3EQofMRCy2VuFKayuZ222UW5OV40r5rgH09dZGjc8oLviRIYTkXgXrgIxUHgwZM52f79qFgYjX0oYNsixPFMGMWD1oKuDx8KuEW8hnThVM0Y2btQjqeFEsAPVCd9DoVw7gZFS2JSHIA7k/knGZX/bIa8keY9QmWDvJGQ1lc3JfaxQVPR7vj6yMH1UkwpBgd/BjaWdUZs9d+KkMsiyRx5miqtxBSDTiRICkQr1nQ==;20:FQbqbWN0v/TmcGrF+GQhz2XBwlQQGME0aMw6yiMMqlZ3V7jr8dAreHPt9CgmnNMdx7q2Xv+5R3RP4JCgirkHa7Xn6P+fEbe6ueI+PS+o97OK7SnOn4RRj55Ek+Z33mibNCPXkib0Uy3PhCmQWs7G9KcDS2ETfgMOq+O4Macy6fM= x-ms-office365-filtering-correlation-id: 59f0cc9c-d8f0-4665-4359-08d47c84607a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075);SRVR:CY1PR0401MB1534; wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148);SRVR:CY1PR0401MB1534;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0401MB1534; x-forefront-prvs: 02698DF457 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39850400002)(39860400002)(39450400003)(39840400002)(39400400002)(39410400002)(377424004)(24454002)(2900100001)(7736002)(25786009)(3280700002)(81166006)(3846002)(3660700001)(102836003)(6116002)(122556002)(103116003)(8676002)(36756003)(99286003)(54906002)(77096006)(1511001)(6486002)(6436002)(6512007)(305945005)(66066001)(6506006)(8936002)(76176999)(54356999)(50986999)(8666007)(5660300001)(53936002)(229853002)(189998001)(4326008)(2201001)(38730400002)(6246003)(2950100002)(2906002)(86362001)(33646002)(2501003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1534;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: <99B98E60E878034C9D55A9EEA8D750D5@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2017 00:32:16.0083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1534 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v360XDSd009962 Content-Length: 1270 Lines: 33 On Wed, 2017-04-05 at 17:16 -0700, Long Li wrote: > Under heavy I/O, one hardware queue may be unable to dispatch any I/O to the > device layer. This poses a problem with restarting this hardware queue on I/O > finish in blk_mq_sched_restart_queues(), becaue there is nothing pending that > will finish in future on this hardware qeueu. This will result in deadlock. > > With this patch, we check for all possible stalled hardware queues when I/O > finishes on any hardware queues. This prevents this deadlock. > > Signed-off-by: Long Li > --- > block/blk-mq-sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c > index 09af8ff..f7f3d44 100644 > --- a/block/blk-mq-sched.c > +++ b/block/blk-mq-sched.c > @@ -202,7 +202,7 @@ void blk_mq_sched_dispatch_requests(struct blk_mq_hw_ctx *hctx) > * needing a restart in that case. > */ > if (!list_empty(&rq_list)) { > - blk_mq_sched_mark_restart_hctx(hctx); > + blk_mq_sched_mark_restart_queue(hctx); > did_work = blk_mq_dispatch_rq_list(hctx, &rq_list); > } else if (!has_sched_dispatch) { > blk_mq_flush_busy_ctxs(hctx, &rq_list); Please drop this patch. I'm working on a better solution. Thanks, Bart.