Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755678AbdDFDih (ORCPT ); Wed, 5 Apr 2017 23:38:37 -0400 Received: from mail-bn3nam01on0110.outbound.protection.outlook.com ([104.47.33.110]:51456 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755334AbdDFDi1 (ORCPT ); Wed, 5 Apr 2017 23:38:27 -0400 From: Long Li To: Bart Van Assche , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "axboe@kernel.dk" CC: Stephen Hemminger , KY Srinivasan 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: AQHSrms40Uir2JJba0uWmbYvvI7Kv6G3faUAgAAz6xA= Date: Thu, 6 Apr 2017 03:38:24 +0000 Message-ID: References: <1491437781-3565-1-git-send-email-longli@exchange.microsoft.com> <1491438735.2787.18.camel@sandisk.com> In-Reply-To: <1491438735.2787.18.camel@sandisk.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: sandisk.com; dkim=none (message not signed) header.d=none;sandisk.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:5::735] x-microsoft-exchange-diagnostics: 1;BY2PR0301MB2104;7:Uy2VyBVhsKY9Cv9Vq5Jt2zvHnaIMEDFffx4SOhrk9/3gBBjTjcGCRRa5yR58ka3Upa44csS2TYoAl87ixwm/3Sh6Aa4xA5L2XXEy+ONK8aM6k+TxpauOOVgdF0bzydSLsg/HF6fYh0jDD+7DlVcdOpNj9KElDMs1Ui9coPK2sqGkY0x8gmH7HzHLYD5b7FMi6TdxAExgdr+UvgsGmmFkZ5Nk9yU/bWJ7yUlh9inq8TRNGvKPs4mlQUz/QOpAASqSyBVsqLUp+z0weUeGT1QCDGDGVifFzE8Bj+4Uxh3OB0rnAUA3UP/XxfgILX1ZmjzgrpRlnC54M/EzCbiZDO8xStMg/uJf2py8EaAZ8ZKih/U= x-ms-office365-filtering-correlation-id: 4332a5dd-7acc-4344-6821-08d47c9e611f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075);SRVR:BY2PR0301MB2104; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(42932892334569); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148);SRVR:BY2PR0301MB2104;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2104; x-forefront-prvs: 02698DF457 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39450400003)(39410400002)(39400400002)(39860400002)(39840400002)(39850400002)(377424004)(24454002)(13464003)(377454003)(33656002)(2201001)(86362001)(50986999)(76176999)(54356999)(74316002)(7736002)(305945005)(5005710100001)(10290500002)(5660300001)(8990500004)(10090500001)(38730400002)(6246003)(107886003)(4326008)(2906002)(8936002)(81166006)(8676002)(25786009)(53546009)(7696004)(2950100002)(3660700001)(229853002)(77096006)(3280700002)(6436002)(6506006)(53936002)(8656002)(55016002)(54906002)(99286003)(9686003)(6116002)(102836003)(189998001)(122556002)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB2104;H:BN3PR03MB2227.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2017 03:38:24.0436 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB2104 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 v363ceVN028381 Content-Length: 1847 Lines: 50 > -----Original Message----- > From: Bart Van Assche [mailto:Bart.VanAssche@sandisk.com] > Sent: Wednesday, April 5, 2017 5:32 PM > To: linux-kernel@vger.kernel.org; linux-block@vger.kernel.org; Long Li > ; axboe@kernel.dk > Cc: Stephen Hemminger ; KY Srinivasan > ; Long Li > Subject: Re: [PATCH] block-mq: set both block queue and hardware queue > restart bit for restart > > 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. Thank you. Looking forward to your patch. > > Thanks, > > Bart.