Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752632AbdLEQlx (ORCPT ); Tue, 5 Dec 2017 11:41:53 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:15756 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdLEQlt (ORCPT ); Tue, 5 Dec 2017 11:41:49 -0500 X-IronPort-AV: E=Sophos;i="5.45,364,1508774400"; d="scan'208";a="64508690" 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: AQHTbZ4g7T3yQq9yCkKeO51Qk7DLeaM060uAgAAFpYCAAAOzgA== Date: Tue, 5 Dec 2017 16:41:46 +0000 Message-ID: <1512492105.2660.22.camel@wdc.com> References: <20171205075256.10319-1-ming.lei@redhat.com> <1512490099.2660.6.camel@sandisk.com> <20171205162825.GA23788@ming.t460p> In-Reply-To: <20171205162825.GA23788@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.171] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1534;20:rWF01ReDa2Gr0OwTpx/KMVpS+QcBYyLT8nlHQnxHbnRCf+UiqSbZDUzh2NnO4wTUn5YngR5/i1y5Ajc0QL+X8iD76TknbYstl62xOmpvELNLBQvOdDu4Vne0LbJI6OLLdaM3HGGUB/L9Z4RmH5LNEbLPZaQmIHGSb4bU3un0rwk= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 7b507ca0-59b9-4f56-11ac-08d53bff1355 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:CY1PR0401MB1534; x-ms-traffictypediagnostic: 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)(2401047)(8121501046)(5005006)(3231022)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123555025)(20161123564025)(6072148)(201708071742011);SRVR:CY1PR0401MB1534;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR0401MB1534; x-forefront-prvs: 0512CC5201 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(39860400002)(366004)(24454002)(377424004)(66066001)(2900100001)(25786009)(86362001)(5640700003)(99286004)(316002)(36756003)(14454004)(76176011)(8936002)(54906003)(966005)(6486002)(6506006)(53936002)(229853002)(305945005)(7736002)(3660700001)(2950100002)(72206003)(4326008)(6916009)(8676002)(5660300001)(3280700002)(478600001)(101416001)(2906002)(6246003)(7416002)(2501003)(103116003)(102836003)(2351001)(97736004)(33646002)(6306002)(68736007)(6116002)(106356001)(6512007)(3846002)(105586002)(81166006)(81156014)(6436002)(77096006)(6606295002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1534;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <6991D4D553E0F44091E36367F38849FA@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b507ca0-59b9-4f56-11ac-08d53bff1355 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2017 16:41:46.9274 (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 base64 to 8bit by nfs id vB5Gg369008450 Content-Length: 741 Lines: 15 On Wed, 2017-12-06 at 00:28 +0800, Ming Lei wrote: > This is still a workaround for RESTART, see my comment before: > > https://marc.info/?l=linux-block&m=151217500929341&w=2 A quote from that e-mail: "The theory about using BLK_MQ_S_SCHED_RESTART in current way is that we mark it after requests are added to hctx->dispatch". Reading that makes me wonder whether you understand the purpose of the BLK_MQ_S_SCHED_RESTART flag? That flag is not set after requests are added to the dispatch list but after requests have been *removed*. The purpose of that flag is to detect whether another thread has run the queue after requests were removed from the dispatch list and before these were readded. If so, the queue needs to be rerun. Bart.