Received: by 10.213.65.68 with SMTP id h4csp2178718imn; Sun, 8 Apr 2018 21:48:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Wl5AebXvYZOuRiYN3Yd/3PQHdb7rkz7YjQzXFjdFkzf1iaLq6rzTaCXQxjnjJh83EqB1j X-Received: by 2002:a17:902:7891:: with SMTP id q17-v6mr37434799pll.364.1523249303270; Sun, 08 Apr 2018 21:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523249303; cv=none; d=google.com; s=arc-20160816; b=VEBi0kC0yMrIEXypr3t4HcWfqmjPVzBQWCSRwAWDD+DFnFIYcGeZlJdCbxgz41tDkA tugLPhkMlHdVMLzX/45UW1v/7V75U2v+EttyzkJMFrs1oIzNIc77JR40wH8k1euOchHG vfsXXtZC1dZM5i6wKJwQo0ImFcw06gLCNs0B3zGsjff9QGjyZoNRoRVvRRIvB43PBHou 3gAt64jMftMo4VbaX5S1cb4A4tUJB6MPgHUH7pJU6LVNfuZG7xDv0j5U1TOzY77z3Ub2 haJ+esGlDm42D+IQOKbqRBiuBlVQOAC7tRCJnfXMS8fIllOaE8O9MOdk8e7V3g9xP1KP FdGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=U/dC7VwxQsIaWUlqFUHHB+mY1ZHCsPToS6ybAk0ERt4=; b=uvsp1AASM3IAjjJ+QIYZeb0jdB1H8jvZaw79nFX8jQn826qRrhjePHffKtDqcgeq+V zR+Ri70H/Xqzlh7QgUF1HRTsiuIGLHFSsTJyiyMa0V+Oi9Ho9K8VQFlI8Bf4NqRj7ZxR JKQCB1BXarqVoXgmGsloG6R+vX9Btwwj+x4r7SKLNIDz7Ze1SuyGb32kOg7hBWntqb+2 yMdBGmZ9GT6McmgURoouQrhyuNpdsHjgcywSrnctsSJX0pXGagiuViRP6xb6Cb5yYIVc J020D5Pa0fOxEKqRkEQw1JGa2NfvBLifnSkGp72jpNx8eZFg+1rSfdW5Zef47MI+YZ9W eWhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jHcMZuEB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si10212602pfg.5.2018.04.08.21.47.46; Sun, 08 Apr 2018 21:48:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jHcMZuEB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753298AbeDIARz (ORCPT + 99 others); Sun, 8 Apr 2018 20:17:55 -0400 Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:51875 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753214AbeDIARu (ORCPT ); Sun, 8 Apr 2018 20:17:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=U/dC7VwxQsIaWUlqFUHHB+mY1ZHCsPToS6ybAk0ERt4=; b=jHcMZuEBunM//+gpRmyo8iNb9S1zYZJcGtmyi4rBdP1mzfvPkFYefnYCq8OtOPT1scONFO46NCbhenxn4rfV8IKuKVBSfxG18/qTd9e6eUDBrqdYcI7AC0JVzL6EfPknohkVYeQEgXcBCatKnszNcipulDsbnE3T6TZYu8SMss8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1048.namprd21.prod.outlook.com (52.132.128.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:17:44 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:17:44 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Ming Lei , Mike Snitzer , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 037/189] dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure Thread-Topic: [PATCH AUTOSEL for 4.15 037/189] dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure Thread-Index: AQHTz5gdzpIHyS8FGUiNk6hfOHmWDQ== Date: Mon, 9 Apr 2018 00:17:15 +0000 Message-ID: <20180409001637.162453-37-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1048;7:1AuiRWL/iayaC2bxA6N/JqpsbU4pC795ZmOjUd6L/hvAjAegeVw0LKAivFznyJQ5j8hnLmUA8W6tx2RMr/Qj+bBF9n2UFEDE8OZQHAPRH2RnrSWEknj13pEUAS8glQvqPkIeoG/Rj8PuWXXdVgO9m0KG13VWSFGi/X0n3hs4JO9ev7PaLVyq0QbSOWoKs7mkIpFM41ulH5S6Xv0Ur5wszODuHGP/dYq5DOnhjBal4DRUtyR7prbNTD/xjmB9t2vK;20:nTzZeDYBH9s8Zt5NM/odm4JGk2bPlvpnlDtxhrtfeHP3Sa2iS7WPhq93lrfGwiyzZMnUdv5PPZk8gH0JW9CiffnVMlwrKJhDIax1cGx9aEJB9aC2+A3I62X59eFG3YqiOzvu9APeXBKrYaCs5qF4SNKgdHEAFZsylifyPGuKdKk= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: a1a21865-ffd9-4c12-c1d2-08d59daf50da x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1048; x-ms-traffictypediagnostic: DM5PR2101MB1048: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1048;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1048; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(376002)(39860400002)(346002)(396003)(189003)(199004)(86362001)(1076002)(99286004)(6116002)(110136005)(3846002)(54906003)(22452003)(3280700002)(105586002)(2906002)(76176011)(4326008)(6512007)(6436002)(6486002)(3660700001)(6666003)(7736002)(59450400001)(86612001)(25786009)(2900100001)(14454004)(97736004)(53936002)(107886003)(68736007)(102836004)(36756003)(6506007)(26005)(186003)(106356001)(305945005)(5250100002)(72206003)(478600001)(2501003)(10290500003)(81166006)(5660300001)(8676002)(66066001)(316002)(81156014)(2616005)(10090500001)(11346002)(446003)(476003)(8936002)(486006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1048;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8mrZZC0+y/5V1exkh/lgkWn9ZqrbvU56OggSNSVK/2p++32xqQB5CIjqJKaEoaN6SPuUzryXJ9O1Ph00ZzgDChFdkqSd4DW5dvBWgr1GlfsNg561bEP5gmWBAFEFzfpCLX2PT78qKcUUfGe6ooKyxqoi3Rlg1rXwUxX4+CltfSYzcR/pYGItuklESDf9KFd+TrVWGXwsR6dpZCn1hAyTLnpGXyo2HfQ5QKIONJMArAvvHL104qYuDKurA83KktroqIcgdU8VGmii+zA+8Yk0kbYP9m5fqgkomjHeU5QPU2NhpmqcrCUxEhFrxaZEMK8Q3am3NbJrnH1SwreiQ21LDoeg2eL36h0LeYdqDSdqdWWSkSBZ74gz2lsBF4bzMAcnb9uS6v5epZxCczoErAeN0c4Ad1DAI9XpYTJnNNaIkP4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1a21865-ffd9-4c12-c1d2-08d59daf50da X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:15.4641 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ming Lei [ Upstream commit 050af08ffb1b62af69196d61c22a0755f9a3cdbd ] blk-mq will rerun queue via RESTART or dispatch wake after one request is completed, so not necessary to wait random time for requeuing, we should trust blk-mq to do it. More importantly, we need to return BLK_STS_RESOURCE to blk-mq so that dequeuing from the I/O scheduler can be stopped, this results in improved I/O merging. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-mpath.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 025e033ecb78..a3223c8fbaac 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -534,8 +534,20 @@ static int multipath_clone_and_map(struct dm_target *t= i, struct request *rq, if (queue_dying) { atomic_inc(&m->pg_init_in_progress); activate_or_offline_path(pgpath); + return DM_MAPIO_DELAY_REQUEUE; } - return DM_MAPIO_DELAY_REQUEUE; + + /* + * blk-mq's SCHED_RESTART can cover this requeue, so we + * needn't deal with it by DELAY_REQUEUE. More importantly, + * we have to return DM_MAPIO_REQUEUE so that blk-mq can + * get the queue busy feedback (via BLK_STS_RESOURCE), + * otherwise I/O merging can suffer. + */ + if (q->mq_ops) + return DM_MAPIO_REQUEUE; + else + return DM_MAPIO_DELAY_REQUEUE; } clone->bio =3D clone->biotail =3D NULL; clone->rq_disk =3D bdev->bd_disk; --=20 2.15.1