From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753801AbdK0ROw (ORCPT ); Mon, 27 Nov 2017 12:14:52 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:62481 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbdK0ROu (ORCPT ); Mon, 27 Nov 2017 12:14:50 -0500 X-IronPort-AV: E=Sophos;i="5.44,434,1505750400"; d="scan'208";a="159767877" From: Bart Van Assche To: "dm-devel@redhat.com" , "linux-block@vger.kernel.org" , "axboe@fb.com" , "ming.lei@redhat.com" , "snitzer@redhat.com" CC: "hch@infradead.org" , "linux-kernel@vger.kernel.org" , "hare@suse.com" , "osandov@fb.com" Subject: Re: [PATCH V2 1/5] dm-mpath: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE Thread-Topic: [PATCH V2 1/5] dm-mpath: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE Thread-Index: AQHTZz20bqgPpUXlrEOz1Cfpd7sf7KMod/IA Date: Mon, 27 Nov 2017 17:14:46 +0000 Message-ID: <1511802882.2993.4.camel@wdc.com> References: <20171127050721.5884-1-ming.lei@redhat.com> <20171127050721.5884-2-ming.lei@redhat.com> In-Reply-To: <20171127050721.5884-2-ming.lei@redhat.com> 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;CY1PR0401MB1533;20:xo2yKx3aMW132kndXe58if7qcfA6/swZHhG5+h/0cZLKNW7g8LfHVYr3F71O6uFTtorXJojyJ28oQRT61CmFFK+JV/Asw/5RNCjFaTIrQR7ihQfvphYiWQyb5Ulu9d7riXoqJ4YI/EG2KtNzXkInAfsjjT7bIpb+p/WA6/4jxh8= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1c0fc697-5311-41b0-68b0-08d535ba5bf7 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603199);SRVR:CY1PR0401MB1533; x-ms-traffictypediagnostic: CY1PR0401MB1533: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231022)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011);SRVR:CY1PR0401MB1533;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR0401MB1533; x-forefront-prvs: 0504F29D72 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(39860400002)(366004)(376002)(377424004)(24454002)(199003)(189002)(189998001)(6246003)(97736004)(25786009)(36756003)(2950100002)(106356001)(2501003)(105586002)(6116002)(3846002)(102836003)(2900100001)(54906003)(110136005)(316002)(86362001)(229853002)(53936002)(77096006)(3280700002)(33646002)(66066001)(54356999)(76176999)(101416001)(72206003)(305945005)(8676002)(7736002)(5660300001)(6512007)(103116003)(50986999)(6436002)(99286004)(4001150100001)(14454004)(6506006)(81156014)(81166006)(478600001)(2906002)(8936002)(3660700001)(4326008)(2201001)(6486002)(68736007);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1533;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <221160CB3AE1554BB81F5CDFA9FCDC8C@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c0fc697-5311-41b0-68b0-08d535ba5bf7 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Nov 2017 17:14:46.3423 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1533 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 vARHHPAR022590 On Mon, 2017-11-27 at 13:07 +0800, Ming Lei wrote: > If .queue_rq() returns BLK_STS_RESOURCE, blk-mq will rerun the queue in > the three situations: > > 1) if BLK_MQ_S_SCHED_RESTART is set > - queue is rerun after one rq is completed, see blk_mq_sched_restart() > which is run from blk_mq_free_request() > > 2) run out of driver tag > - queue is rerun after one tag is freed > > 3) otherwise > - queue is run immediately in blk_mq_dispatch_rq_list() > > This random dealy of running hw queue is introduced by commit 6077c2d706097c0 > (dm rq: Avoid that request processing stalls sporadically), which claimed > one request processing stalling is fixed, but never explained the behind > idea, and it is a workaound at most. Even the question isn't explained by > anyone in recent discussion. > > Also calling blk_mq_delay_run_hw_queue() inside .queue_rq() is a horrible > hack because it makes BLK_MQ_S_SCHED_RESTART not working, and degrades I/O > peformance a lot. > > Finally this patch makes sure that dm-rq returns BLK_STS_RESOURCE to blk-mq > only when underlying queue is out of resource, so we switch to return > DM_MAPIO_DELAY_REQUEU if either MPATHF_QUEUE_IO or MPATHF_PG_INIT_REQUIRED > is set in multipath_clone_and_map(). Sorry but in my opinion the above description shows that you don't understand the dm-mpath driver completely. > diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c > index c8faa2b85842..8fe3f45407ce 100644 > --- a/drivers/md/dm-mpath.c > +++ b/drivers/md/dm-mpath.c > @@ -484,9 +484,7 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, > return DM_MAPIO_KILL; > } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) || > test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) { > - if (pg_init_all_paths(m)) > - return DM_MAPIO_DELAY_REQUEUE; > - return DM_MAPIO_REQUEUE; > + return DM_MAPIO_DELAY_REQUEUE; > } This patch removes a pg_init_all_paths() call but you don't explain why you think it is allowed to remove that call. Did you perhaps remove that call by mistake? Bart.