From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755989AbeASQGQ (ORCPT ); Fri, 19 Jan 2018 11:06:16 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:12279 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755775AbeASQGH (ORCPT ); Fri, 19 Jan 2018 11:06:07 -0500 X-IronPort-AV: E=Sophos;i="5.46,381,1511798400"; d="scan'208";a="172308203" From: Bart Van Assche To: "ming.lei@redhat.com" CC: "dm-devel@redhat.com" , "hch@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "osandov@fb.com" , "axboe@kernel.dk" , "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: AQHTkAXlp7DN5JBZKUeyLfttG5XpOaN52OmAgAADroCAAATDAIAAE3uAgAAE1gCAABc0gIAAaoKAgAAZS4CAADjnAIAAhGAAgAADu4CAAAkRAA== Date: Fri, 19 Jan 2018 16:06:01 +0000 Message-ID: <1516377960.2646.4.camel@wdc.com> References: <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> <1516375212.3190.4.camel@wdc.com> <20180119153333.GA14827@ming.t460p> In-Reply-To: <20180119153333.GA14827@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: [199.255.44.172] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1130;7:dqdHJ/XalfhKrXrJ4TA62d7JFybu5sHW+B6UHuzN+uu+vGQG5cZUUevKiR2ZdIfv8fPl5i0hrc3sol+zfUJ1kuiYDFjGzO6uosDqVc7cXklQ5uDwft04HjPs21UZg6hChcPbE4a4gcyLB6OI9/fTvDypvrwEX1TOtC3NUK8DwvfvMuQVrmYi6QU2AJ+KQW5gq/TNXIUTEEEBDPjpAfF8TA3nYlIPVt+AuUg+5skto/dhXqIQkyDO8JVC4/k3rR3D;20:qzB65L32Juo7Y59+TD0rfE/BQ217y2nRL9nVib1Tsau+I6MdB+p/W6WqJIY1m0CPyj+e90mkr4UXVOaimcPeMSPI1bbjqNWzapiDmDmm5uZaKGQ60LcXarfb90r6/p2rHf9DfmkqfNG9DPjI6Tc4aScjk+zuMgJ43QzzgrXZL3g= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: e4c64143-8afb-4bc8-cf95-08d55f56893c 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:CY1PR0401MB1130; x-ms-traffictypediagnostic: CY1PR0401MB1130: 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)(93006095)(93001095)(3002001)(3231023)(2400079)(944501161)(6055026)(6041268)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:CY1PR0401MB1130;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR0401MB1130; x-forefront-prvs: 0557CBAD84 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(376002)(396003)(366004)(39860400002)(39380400002)(346002)(189003)(199004)(377424004)(25786009)(3660700001)(5660300001)(81166006)(97736004)(93886005)(229853002)(6116002)(4326008)(8936002)(102836004)(3846002)(14454004)(66066001)(105586002)(6916009)(6512007)(2351001)(106356001)(6246003)(6436002)(103116003)(5640700003)(53936002)(2950100002)(72206003)(68736007)(2906002)(86362001)(316002)(3280700002)(6486002)(77096007)(478600001)(26005)(2900100001)(305945005)(7736002)(54906003)(76176011)(81156014)(2501003)(36756003)(8676002)(6506007)(99286004)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1130;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-microsoft-antispam-message-info: hEAea12XTNq6nXoQ+cGEgbHLeEc6NaPKExWy/hX0/FEDJSbU0NBGvkZ1Oc8CVoNbXGHqvjAbDNrnNaQtROHbOg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <14F7CA88D8DA77499DEB1FF018078665@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4c64143-8afb-4bc8-cf95-08d55f56893c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2018 16:06:01.5833 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1130 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 base64 to 8bit by mail.home.local id w0JG6Lfa014459 On Fri, 2018-01-19 at 23:33 +0800, Ming Lei wrote: > On Fri, Jan 19, 2018 at 03:20:13PM +0000, Bart Van Assche wrote: > > 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: > > > > 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) > > > > Bart. > > Yes, this one together with Jen's suggestion with returning > BLK_STS_NO_DEV_RESOURCE should fix this issue. > > Could you cook a fix for this issue? Otherwise I am happy to do > that. Hello Ming, I will look further into this. Bart.