Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbdLFQHY (ORCPT ); Wed, 6 Dec 2017 11:07:24 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:32040 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbdLFQHV (ORCPT ); Wed, 6 Dec 2017 11:07:21 -0500 X-IronPort-AV: E=Sophos;i="5.45,368,1508774400"; d="scan'208";a="167025645" From: Bart Van Assche To: "ming.lei@redhat.com" CC: "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "hch@infradead.org" , "martin.petersen@oracle.com" , "linux-scsi@vger.kernel.org" , "axboe@fb.com" , "hare@suse.com" , "holger@applied-asynchrony.com" , "jejb@linux.vnet.ibm.com" Subject: Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle Thread-Topic: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle Thread-Index: AQHTbZ4g7T3yQq9yCkKeO51Qk7DLeaM060uAgAAFpYCAAJ2AAIAA7uSA Date: Wed, 6 Dec 2017 16:07:17 +0000 Message-ID: <1512576435.3297.3.camel@wdc.com> References: <20171205075256.10319-1-ming.lei@redhat.com> <1512490099.2660.6.camel@sandisk.com> <20171205162825.GA23788@ming.t460p> <20171206015212.GB26512@ming.t460p> In-Reply-To: <20171206015212.GB26512@ming.t460p> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [199.255.44.171] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0401MB1530;20:YsnOuw0z11mJxdWiK7+FNgFzORsqJfPx/i6XFbbYm5CDymY4zmFcAwFvB5vyolAg7N+QuHWzxgFFpHFWwKQXRS7lW1wdU8G9Dw8OtpS4QWHMN5puvOXTmudeAOWwiXitkCNRLwtcTyTzm2Ye9nrv6qaq3pT4wWBsCKc6BwdzsJs= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 30807494-d26c-4254-0af5-08d53cc36c40 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286);SRVR:BY1PR0401MB1530; x-ms-traffictypediagnostic: BY1PR0401MB1530: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; 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)(2401047)(8121501046)(5005006)(3231022)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BY1PR0401MB1530;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BY1PR0401MB1530; x-forefront-prvs: 05134F8B4F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(376002)(346002)(377424004)(24454002)(189003)(199004)(2900100001)(5250100002)(8676002)(66066001)(4326008)(103116003)(2351001)(36756003)(6436002)(5640700003)(6246003)(5660300001)(3660700001)(53936002)(6506006)(3280700002)(2501003)(6512007)(81166006)(81156014)(14454004)(2906002)(33646002)(478600001)(99286004)(3846002)(2950100002)(86362001)(54906003)(229853002)(6116002)(72206003)(7416002)(7736002)(6486002)(8936002)(101416001)(305945005)(25786009)(316002)(6916009)(68736007)(105586002)(106356001)(97736004)(93886005)(76176011)(102836003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0401MB1530;H:BY1PR0401MB1532.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30807494-d26c-4254-0af5-08d53cc36c40 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2017 16:07:17.2718 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0401MB1530 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 nfs id vB6G7TS7001147 Content-Length: 1463 Lines: 33 On Wed, 2017-12-06 at 09:52 +0800, Ming Lei wrote: > On Wed, Dec 06, 2017 at 12:28:25AM +0800, Ming Lei wrote: > > On Tue, Dec 05, 2017 at 04:08:20PM +0000, Bart Van Assche wrote: > > > The patch below is not a full solution but resulted in a significant > > > improvement in my tests: > > > > > > diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c > > > index 69e3226e66ca..9d86876ec503 100644 > > > --- a/block/blk-mq-sched.c > > > +++ b/block/blk-mq-sched.c > > > @@ -226,6 +226,7 @@ void blk_mq_sched_dispatch_requests(struct blk_mq_hw_ctx *hctx) > > > * TODO: get more budgets, and dequeue more requests in > > > * one time. > > > */ > > > + blk_mq_sched_mark_restart_hctx(hctx); > > > blk_mq_do_dispatch_ctx(hctx); > > > } else { > > > blk_mq_flush_busy_ctxs(hctx, &rq_list); > > BTW, this kind of change can't cover scsi_set_blocked() which is > triggered by timeout, scsi dispatch failure. You will see that > easily if you run the SCSI test script I provided in the commit log. Hello Ming, I am aware that the above change does not cover all cases. That's why I wrote in my previous e-mail that that patch is not a full solution. The reason I posted that change anyway is because I prefer a solution that is not based on delayed queue runs over a solution that is based on delayed queue runs (blk_mq_delay_run_hw_queue()). My concern is that performance of a solution based on delayed queue runs will be suboptimal. Bart.