Received: by 10.213.65.68 with SMTP id h4csp2202540imn; Sun, 8 Apr 2018 22:23:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx49I68k9YjyTTKPtkoE1W+RZftjojRp78howPm9qQTJdnCv+U/XoPTYtY3IL1NfIh1vPfEle X-Received: by 10.99.152.10 with SMTP id q10mr24800553pgd.40.1523251438099; Sun, 08 Apr 2018 22:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523251438; cv=none; d=google.com; s=arc-20160816; b=cuZ6tNM4LV2EXzWFD4dpPN3impgyU0QLuP5wIcCbWHbaxZPyLfe5R0ikZLPQm/DLCQ lni+LDP4eOAFuLorzOONasqjKilgnMQJQMtnEqF9CySifbyBBrXYjzK4DUsqvvN6vXgB cwkmkqhL+DlYRBp5s8tZGGJulMIO2Hy+0ThuMGQMlNW25hYreBNcAI3qTiHMBMlKLhFY xt725TcsOBqROHU1/Gng1OxWwwm7INPXGziYoYkFBordbA1Ipf6xcsi5HHT5J9/SmmG3 uVQUdfr5/S8I4Dyw38zo4qdpDXZVMKnDZol4n70yt/jk+YhwvBpD9SnBc5or13xLePFS 87qg== 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=yEtiVDME/0l2wI5PzWjxaXuYgQNkzzr7qL0upqy4JzU=; b=VDKuZjCG8tWGaGZFkAAatuALgBCoKvGASVqSejw3m/KRAT0jMjBXGcAWWwlwakbYyT 2a1inXcZE9Vwz9HDdel25OImYZtpaMzgkAb/M77lBBBBXVICZpuFvXB/9X/cJtbtoh2u IMCVW73u+Xa0od3RKXuItvPkh2Cy78/iin0ntrGKQI8C6xpnWBcMfv/gKQ1AbwXpexv5 4CAUA/zUPt0r2iDyQMF5qmc3rA841WiSQw+W68Kv8JNuNnjlaFrIM3tOcewRyNvTyqIP MtWuwkNJMCaIU7tFxZLdHr1Uo9ijPup+vdWs0r25wHlbmyYzhccRUoOknAL2KEs/lANg 4hIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=c8mCqUA8; 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 g3-v6si14125783pld.513.2018.04.08.22.23.21; Sun, 08 Apr 2018 22:23:58 -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=c8mCqUA8; 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 S1754791AbeDIAXA (ORCPT + 99 others); Sun, 8 Apr 2018 20:23:00 -0400 Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:20813 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754734AbeDIAWu (ORCPT ); Sun, 8 Apr 2018 20:22: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=yEtiVDME/0l2wI5PzWjxaXuYgQNkzzr7qL0upqy4JzU=; b=c8mCqUA8bJwzQj0QpbuZHJ9+s/p+wz5ryJUHjx4gEbO+rSXW4Z72CKFMjibTkLosGR+/91im1y+GBtcspDKXuTmDG7m3ZJl+nhbb4KMnTuxn7zN1z0yuZwbXOtEty852EK/ciMJK45sEoLPOvZlvqlJh/rY9h2nXzRXmgqcnatA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0966.namprd21.prod.outlook.com (52.132.133.24) 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:22:45 +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:22:45 +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.14 033/161] dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure Thread-Topic: [PATCH AUTOSEL for 4.14 033/161] dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure Thread-Index: AQHTz5iFt6UhgfPJA0KObtb923wp6w== Date: Mon, 9 Apr 2018 00:20:10 +0000 Message-ID: <20180409001936.162706-33-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0966;7:YKSTzF1pmC6MjbmhQk5smF0WESIQy/hVZidzrfWDIIAicVpkW1gbfwnt3SIukpUx+Ux0DYmuzTd6yi7anRgC5QKcWk5OgHWLsfzXtmaNog5lIKSHi91iGZniBaR2Ardr+p7nDusiABtozNWKIJ0gtq9PxahIwOhgxeiS5vt1/EArwlkof7K0Y0hhWJwN2AOF79ZHhPP3sA+a05Xw+DPaLPS/F/4mGd/XFlaRtZnPHxquayGbeyDE5Yzkd6Mf5A0X;20:fEhkAO2ikS0hZ9GsHGesIIsw/Vmr3ubFeKs4krGJ2pi8+msDFgrx22p+rbRnIPoazJbxuxMAQ63TeMdHS/HYphggBKzOy5Yx/j6shXpsMfkxjLy6A1DhdVPzQhCB068IU63RQZPiPw4sh+hUAfiATOnsDnvP0I4UeEv+ylzuiN4= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 99f9117c-1362-40a0-ad62-08d59db00428 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0966; x-ms-traffictypediagnostic: DM5PR2101MB0966: 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:DM5PR2101MB0966;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0966; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(39380400002)(396003)(366004)(199004)(189003)(6512007)(316002)(59450400001)(6436002)(186003)(6666003)(2900100001)(8936002)(486006)(6486002)(6506007)(10290500003)(81166006)(22452003)(25786009)(1076002)(81156014)(53936002)(106356001)(10090500001)(5250100002)(107886003)(102836004)(76176011)(8676002)(66066001)(2501003)(446003)(476003)(36756003)(99286004)(478600001)(86362001)(72206003)(2616005)(68736007)(5660300001)(305945005)(3846002)(6116002)(26005)(86612001)(14454004)(97736004)(3660700001)(4326008)(2906002)(110136005)(54906003)(3280700002)(105586002)(7736002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0966;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1zlQG1GifkVOAKz8D6oWClwgSd6BkI5QqFrSOeDXoqeElf+f+p4PB372+BoyrxmQQaMhDiCVxtN/9t1bmALEtMSCU/sU3E9Q/OIDAqFT6yu8dgqNctThMmrmhP/NweY1LLCYL1+f30s4uKftDV36+5hfJJO767ooCzXHYih92lhypO5YjcsxhWsIxKu6mqApkOIV02UmihVeTvTmZzMI8n/jRkaTqnAlHubDb0qVWnloD4ltg4w6AGcC/6OH4A6ifgQZMr59XtrBTg605bvTI+WKjCRyUneK0quHNAUW7zDi9F2Op3aGbKQGVccYZHoc98HLN0fxyah3cwgBD/zq7PsuUGgeA9fdvJvPCk43uDT3iFkdfVR/cbfjqdYGqditKRdBbOb8DYkPkmy0sZGar41kwYPj1DuWN+AH0wCT+Vs= 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: 99f9117c-1362-40a0-ad62-08d59db00428 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:10.2228 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0966 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 2704a55f8b6e..8b7328666eaa 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -502,8 +502,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