From patchwork Tue Sep 7 14:21:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 12478835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72A5EC4332F for ; Tue, 7 Sep 2021 14:21:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 543DC6103D for ; Tue, 7 Sep 2021 14:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237928AbhIGOXD (ORCPT ); Tue, 7 Sep 2021 10:23:03 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:17679 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235580AbhIGOXC (ORCPT ); Tue, 7 Sep 2021 10:23:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1631024516; x=1662560516; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NfKgIZnJTpnqdTH7n+03JPvfkUkveonE5vDXeKwOr7g=; b=E0EGMAAcwjgq/tMVEGSLwwANe8WLq2A21BJUprZvpIvRgJdU0ZpVnxXI HD7MQ6jm4P/ziiOO1NmGXZJAZ8GBnTL+b4Vr24NY4A6S4jewPNW6Qa3G1 rOejIjoFz8JcB1iaInrwu7BuwScYRNhA4jePQwlXuPSdV1bdX+XPFOeSw ELtGXOxfT5M5Mw7FNS6D7h4C6+qkxKFctQ3Gis/tx20LQVaa5tNlb9lfk tGcLXQtIoCViL35xKp4CARW4yQv6EZXTsMVjpJLyKyL6NrkQFcbKBAtad e5eZB2rsWTsC3lPcQaGL2FYrP/E/tBWHwdk5zx+4+gRQRH90BJuq0prk2 g==; X-IronPort-AV: E=Sophos;i="5.85,274,1624291200"; d="scan'208";a="184162950" Received: from mail-mw2nam10lp2105.outbound.protection.outlook.com (HELO NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.105]) by ob1.hgst.iphmx.com with ESMTP; 07 Sep 2021 22:21:55 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J6h0jrxShObqfBT7nsQszLKtmzQY+sXghNgsmbP+kboOS/VWJp7E6qctgkq2Ano8+8FAzv7JE7DBye3bA0sWGsa4tstPTwWwi6jDXFC2mJsq5oYyCQz+dtw70slYR/GMYxesCED2xdWYOWWi5eDsXpHfsoeG3M6pHPPiu3/FM9sPgqB2GB2IEv1cB+rIxqyJ7++sFawIo+nawJ1W99V8Fy70ehwh4pmXLJrYpT3hwhzxBX3WrRYTwBdAfcrjfD/YlLyS9Yq0xWp39+82vRUuzV5Q5cI9Wv4sBeTCCTeWo4xtuvpe+FEmVqV2HQwNObg16i+1LtDr/iM7mC0xVVhH3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cRbK6/CmJgEd3dgnXdcRLqexu2Y4uNocW/0E58DQUA0=; b=VDd8Qln8fB5k1ZIP/2mGxXOYzCiiBEYt54QI0g7kXCEm9jL5tZ4dWvWHuqkvN60LS9/ez8oc3j05cHcjMI4h0D4OGlQa3Xnh3xaf00gGT4uGBUR1xJh918oYe+fD95zFdguQwrI1iKeZ/GnBXXhLc4MkxcIkPtZjUYQTnog6XY4fFeeh3vw9wlzmE0etrernsamDb8pUCVwm5GyAD2uh4lKucwIv8e0z5b8CCvPKeCF0S8wcl/WgNcM1ICwm+ujkurbpH5miX3dBBDi2MtTx8Npt/auC9lyqL0wn4XrYHtkjEB0YUVHjcgvlp7UoSVdKeOxgu7YnAw76UdQca7IlWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cRbK6/CmJgEd3dgnXdcRLqexu2Y4uNocW/0E58DQUA0=; b=Tuq5bIgDaYQflyiHEPuB/QZAe+YM9b9i+sVHi+OG/J4jMEf6NYwz6UMUCnnQBrl6Ty8R3JJPnapyuacExTHrcdGE39iDnkyT9feE2nZT/eDTQpVrSoPbgdU0K57h5TZqtGdYPMK5nnCiKLSjKdWU1sQEc2yvfhvIaEUHX/xh8ks= Received: from PH0PR04MB7158.namprd04.prod.outlook.com (2603:10b6:510:8::18) by PH0PR04MB7382.namprd04.prod.outlook.com (2603:10b6:510:1e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.21; Tue, 7 Sep 2021 14:21:55 +0000 Received: from PH0PR04MB7158.namprd04.prod.outlook.com ([fe80::3d04:c2fb:e69f:27e8]) by PH0PR04MB7158.namprd04.prod.outlook.com ([fe80::3d04:c2fb:e69f:27e8%6]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 14:21:55 +0000 From: Niklas Cassel To: Jens Axboe CC: Bart Van Assche , Damien Le Moal , Paolo Valente , Ming Lei , Niklas Cassel , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH 1/2] blk-mq: don't call callbacks for requests that bypassed the scheduler Thread-Topic: [PATCH 1/2] blk-mq: don't call callbacks for requests that bypassed the scheduler Thread-Index: AQHXo/O1j+Dxeg06HkOKzFhsF9jhAg== Date: Tue, 7 Sep 2021 14:21:55 +0000 Message-ID: <20210907142145.112096-2-Niklas.Cassel@wdc.com> References: <20210907142145.112096-1-Niklas.Cassel@wdc.com> In-Reply-To: <20210907142145.112096-1-Niklas.Cassel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.31.1 authentication-results: kernel.dk; dkim=none (message not signed) header.d=none;kernel.dk; dmarc=none action=none header.from=wdc.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3eac2590-4489-4a9a-9f43-08d9720ad84e x-ms-traffictypediagnostic: PH0PR04MB7382: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EI5LCfTFsZJMmLO4WfD62UuKP/VgnoKMKFQI1LG8yceaXrydwxQy/p7hq6JG8Qx2ORqFKH1tA5NykWKRT5jL8vSNj66YzlwVxJL9lRj6TJZt7x6uotPqh3AAy5mBYKQsn/6j4+f4cmMN/PXV4VOM/8QnC1Ino0Ji2D5kO8jednHV0BcgqufChO+wKsiSdGX3fxhBcMzfJcz/boZShvvDiPkQm/xp0ANmkES25UZAeZjUrnlsuKBUZgYgV0ZEVqDie6cZBqNeUQH4r6Hq3aJ8vnlmZu9jg1B9qA04QH0KvpGh3MdjKfhdumplO+faH9CsTKYEb0pOBqSVZ249N18piR7njWije6ORsaN/ZowDs56NsOKFUDq2+ExO/h8VZ6LtlhpMUcOe2LSwgRsPDhJG0OEdWvWKRJj+OhE84RZlcuqgQi1l+Vops/qCEuAu5XogN4s9PGAuHR1OV8B/KooJ+rNr0plv+RngHK+VuZGX+Z2YyHiI4YtEtsI2lu/aLaoIIRPcCSLvKxdmTH8H5VRtLKVHDtXlbQn7vi3zOQFFBtoiMHyxggvRcmdz+x1nKmZpTInPIDjRalMabp+PO/ll1YNoJAPe69OQvBrI7JCcHL4oXgxgo4yOVjI59FLUjfrxSOjxeZpmVtsLmUJFB9KzjFDB9sfNiQbjuDFqivXKQOOYbYoY/By1TiCvE+2FQqPI8tdA9tAUAhQVSadAcFBnug== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR04MB7158.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(39860400002)(366004)(136003)(346002)(6916009)(2906002)(478600001)(5660300002)(8936002)(2616005)(36756003)(186003)(1076003)(64756008)(66476007)(26005)(38070700005)(38100700002)(71200400001)(6512007)(122000001)(66446008)(86362001)(66556008)(76116006)(83380400001)(4326008)(6486002)(8676002)(6506007)(91956017)(316002)(54906003)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?TxTU0HNC2n0uFsHex8u1RDb?= =?iso-8859-1?q?MceoUu74vp8a4FUVJOhzuiIhs+oGkfaJ4iYD//jz+RcHoNHtohbnF1HhGrSt?= =?iso-8859-1?q?z9Vjad0KUlA7lhLLrGDz9YP5N664Vri4hiox5px6lJ7MfwhcdNFwPVonnc8c?= =?iso-8859-1?q?wTUWvXg77b8BdnkWj1gP8YwNLd0ptMPFQkfXL40WPCJwzFSeSpy3lZVqkihT?= =?iso-8859-1?q?nNnzjEQTk7jnJs+EAGJgxAVr3cY61ADrTcsXDGiFEVCxYJn33lzHAcsoEjFR?= =?iso-8859-1?q?7yF218BMZ6Qic2TUCy79mfThGdmMZ5jZhIkkVDmlb76OpisHNTGLra00fw5p?= =?iso-8859-1?q?57T/NIbF5Gh7ro1C+HwLLpFYP9FDX2hoHRv3pZzMnIuFy7lnaqCzk1ONS3qy?= =?iso-8859-1?q?0bKgAMWW6hq/CnfM7OPHrKfl8HK49Ij3glQ7FlKiUgRN1SDk8isxrWSXSrDw?= =?iso-8859-1?q?o2ChSI2x110gSnnIO/RC55c9eoufN6Igid49iD8GhZSZd6ZQADseQ2bSQzDQ?= =?iso-8859-1?q?j9W6D3ydVeLKTASyxd+tbVRZhH1kFe2v6LwKhBiMv/aBOuwLreIXINwdgUi0?= =?iso-8859-1?q?r1e6ONiyg93gdgrX7rJYq/J3u3RhwD8msBcvMnZaeRK56Cr/LC7HjUi8DfXS?= =?iso-8859-1?q?RXJitBYAnTd5ewuDGvBI9qax4nSuGSpUW1CpOQJ/coWKRGxNfhjvdfxPDd1+?= =?iso-8859-1?q?sgDR7oKlVVR+MaOBmJQ0s1cnuGtX0g5BctvwV4Flk9kYNcX3bO43IXk5seJ8?= =?iso-8859-1?q?TVnR7TnXXfr9SYvWyKVBzhSbaViIJcgWsxVcwhu2arT77QzomqXeMgsiRL0v?= =?iso-8859-1?q?nnGvFO/mFRqgV1An3DOdTsj1847C1KgaKQSEw7bobfP0BkpB0GTA/Lqha461?= =?iso-8859-1?q?qqxSDqImGjEQw8w3+t76NporHNFUs28cWKjWplVZ8L1sYM6wcNFLNCF3B/iO?= =?iso-8859-1?q?/Fsy/P1sQZxteBprSSGaPNHtTQIX6J8upPvxpmNe99zHGmHB8DZSK4iMZ9y+?= =?iso-8859-1?q?f7TZiEyo3kYpTzy+Bu6ELCR/TqQTrPN9sSTbZsrMTvzakG2VgTfofnp6F5g0?= =?iso-8859-1?q?Ern8tQb1+CaoWX/KhV2DUvsWZfvPTRvpHJQNpEgMzlYiEh64t0lWPDI0aH5O?= =?iso-8859-1?q?PRQFEDO4ouhAwffQ7l4BOKstfBR0afXp5ipRBlMjHU0fkZEViDNNLUYdtpuq?= =?iso-8859-1?q?KmUNZGC0y9X/w8g2erO3imL6uIVhQQifrN2FwsA6if9u37anpkSOxDq5OEOo?= =?iso-8859-1?q?3MvhQcxuyB3NrYhSykMGhuBmgCLYXTevwaw18CIGypUd+XvLcorELdMi7aNm?= =?iso-8859-1?q?XEGsfjW3b9G//48ZbKG6tPjohQtcAlY6HBxkBcLgtq+mIqmoPKBFbRDki+I0?= =?iso-8859-1?q?PC+Kebc0mhkBwZ9BQqi1DMQ=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR04MB7158.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3eac2590-4489-4a9a-9f43-08d9720ad84e X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2021 14:21:55.2243 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CZ7xs9Ti7QGdeBSldJyHMhsv5b6NUWyKRQPXJn/I/h5JCLUGSLi2mI/IiVdpRn3YZRWAOBki/M1sdF67XP7F9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR04MB7382 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Niklas Cassel Currently, __blk_mq_alloc_request() (via blk_mq_rq_ctx_init()) calls the I/O scheduler callback e->type->ops.prepare_request(), which will set RQF_ELVPRIV, even though passthrough (and flush) requests will later bypass the I/O scheduler in blk_mq_submit_bio(). Later, blk_mq_free_request() checks if the RQF_ELVPRIV flag is set, if it is, the e->type->ops.finish_request() I/O scheduler callback will be called. i.e., the prepare_request and finish_request I/O scheduler callbacks will be called for requests which were never inserted to the I/O scheduler. Fix this by not calling e->type->ops.prepare_request(), nor setting the RQF_ELVPRIV flag for passthrough requests. Since the RQF_ELVPRIV flag will not get set for passthrough requests, e->type->ops.prepare_request() will no longer get called for passthrough requests which were never inserted to the I/O scheduler. Signed-off-by: Niklas Cassel Reviewed-by: Ming Lei --- block/blk-mq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 65d3a63aecc6..0816af125059 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -328,7 +328,12 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, data->ctx->rq_dispatched[op_is_sync(data->cmd_flags)]++; refcount_set(&rq->ref, 1); - if (!op_is_flush(data->cmd_flags)) { + /* + * Flush/passthrough requests are special and go directly to the + * dispatch list, bypassing the scheduler. + */ + if (!op_is_flush(data->cmd_flags) && + !blk_op_is_passthrough(data->cmd_flags)) { struct elevator_queue *e = data->q->elevator; rq->elv.icq = NULL; From patchwork Tue Sep 7 14:21:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 12478837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9607C433EF for ; Tue, 7 Sep 2021 14:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D99446103D for ; Tue, 7 Sep 2021 14:21:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238250AbhIGOXE (ORCPT ); Tue, 7 Sep 2021 10:23:04 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:17679 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237973AbhIGOXD (ORCPT ); Tue, 7 Sep 2021 10:23:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1631024517; x=1662560517; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8Sgz/gGlnMD8XyPNt5y7peU1arQEbdMxWoyt1ocbzhI=; b=cqXRzvFk/dxaUwwIrHjkciegzGP/1jcrDfh9B1CDsXv92Yfg56yTlaM3 Bx5YORR0H7fsEmh6GjyrMX0GkgRw1vRDg0FNWVRHann/Cxem9CghaWbs5 Z/tbHfqdyO/tr2yDRSTRfZ4TE+PeHn9HmEwnjX+XEufVIdTuji1K/iW/g bG4fkB+DVUTk5ntGPYaB2QSrYBwIDq6IE6ZJCGO8MlIG3pmkDkbgkIIra AOj6oTqRM5QlN7VBMfdM3lrX+pmelYri3Q09UyPhuvOL9WBpIfMaFIexK 2H7MxcV3BVKpDyi22aa49AxXyQZOfDCurGfbSKYhdBuBVpYT6IFa/YgOJ g==; X-IronPort-AV: E=Sophos;i="5.85,274,1624291200"; d="scan'208";a="184162953" Received: from mail-mw2nam10lp2104.outbound.protection.outlook.com (HELO NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.104]) by ob1.hgst.iphmx.com with ESMTP; 07 Sep 2021 22:21:56 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HRTc7BjlWVqaFo672mNZuwHd+itbJY55d6+cblpowBY1V6U5RKwP2NgRQf138TaqnqVkNZ9JtqN8GSb/9JPs3TlV2/wuAe41c+3ilNFHqeArT6+zRh3eH1TzpwdBrVNfYNilyIN3zUt3hAjJpFR6QrHdL08tUfvN4NAZmQKbKXS5wX/axWenILYlSpBlCewpbZpzvQeKrx3MruOhnlYa/WcanyKEo2eTWL86ls9bonvOkpA4DHtvleqsCJRB1zdY6Az3KsnFCoTdtYCGdp5YI2NiS2Oiwp5qXv6vijZgiAcv2UMsSzxADrKhxgQlBH3OOEPBCMwmbIiUYoANJKnpJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=uOY78QPH6YwX0qHjo/C9tjIsWS3wkLb3W2wzAeqjYf4=; b=TsOxDpO9eodLirzJVgp0LT5u2EQYME4VOhacIrW54Im8LJKEoEwER/oVYnwmToZvw+6DHXWyVlIJoWLMQ6rBTkfClRHcpMZRtKrRZG3P3lfV+iKwLuKG0BTHfZ+2CTL3/d7WdZ89G2s/DRhB2OhWnz7UE4BE6FfzTol3yXuG+IxSaWn8VTBajJJMTnWMZlgR3+8+EesJg2/cAS962bUA94xZhh/lm9/e3Ap1/wr6zjqfIrUIOT1JI/fhgWeQ4PMCzK7jvg+6vH+eIg23jErfFToSwV8/1etmPUAOf62bFERJhL70As164RveZbtw7PFPqoXcP1+FvyAG8OexeMO5Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uOY78QPH6YwX0qHjo/C9tjIsWS3wkLb3W2wzAeqjYf4=; b=eKhpHvkn7PaozYQxaMgjnH5C0+ESlXdZqaWPpJN5Ycd+8Xcrx9Y7v3kjsNj+pZXYLjT+zYayeK5FWdOLoZetS8BzQWYSD7o+G7BDPWF8t4r2liUQiv0wiQ8ahd9pmXos5qNrUBO7CeBvn01TAeUeqyAkTUwIeDbaaQarqTMbjfM= Received: from PH0PR04MB7158.namprd04.prod.outlook.com (2603:10b6:510:8::18) by PH0PR04MB7382.namprd04.prod.outlook.com (2603:10b6:510:1e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.21; Tue, 7 Sep 2021 14:21:56 +0000 Received: from PH0PR04MB7158.namprd04.prod.outlook.com ([fe80::3d04:c2fb:e69f:27e8]) by PH0PR04MB7158.namprd04.prod.outlook.com ([fe80::3d04:c2fb:e69f:27e8%6]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 14:21:56 +0000 From: Niklas Cassel To: Jens Axboe CC: Bart Van Assche , Damien Le Moal , Paolo Valente , Ming Lei , Niklas Cassel , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH 2/2] Revert "mq-deadline: Fix request accounting" Thread-Topic: [PATCH 2/2] Revert "mq-deadline: Fix request accounting" Thread-Index: AQHXo/O2L+LBuS/YJECb1WaT3ju4YA== Date: Tue, 7 Sep 2021 14:21:56 +0000 Message-ID: <20210907142145.112096-3-Niklas.Cassel@wdc.com> References: <20210907142145.112096-1-Niklas.Cassel@wdc.com> In-Reply-To: <20210907142145.112096-1-Niklas.Cassel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.31.1 authentication-results: kernel.dk; dkim=none (message not signed) header.d=none;kernel.dk; dmarc=none action=none header.from=wdc.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 88aa69fe-3444-42e0-55b5-08d9720ad8c6 x-ms-traffictypediagnostic: PH0PR04MB7382: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:530; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7QZTT/Ij7oW2kGVsU3eHlV0ZI6mSSQYK2pN6cQA072BICTFwOlKsq0mJOATFKRwynhfx/G/VIFRCyNUrF/bwTFGRWMo/gP0vdNm3jSDrR2EKSqpWSDkWhrJwOECLEWNaBowirydjdiaffjtEhxnXIOPlSuxAdaP8ec/8+SXkN+3LNq2ItpTIjfBA/r2EhVZyZ2ogm88bvrOzMgCOC4caXt9XbpldlECw9mSaY19vcSo50mo4NJbjNlXLkixv/ayBd9dZbffAmj7Sea6eVbGkx2OBEK54+mrC49QkAR/kiN18z0EjBkUGkCRHkPCPMgVL9X0/Dw8a+ahbqmXbVzuPhMQh1JCTf7bkeqDMxPkIeqclxXoaS0Ruwy9wZCfFSjNK9odhtv8sMSEp/QmS8OfcVu4uA+I1T/Hycv6rt8ulok7kX/4cor7clqRL+7FDo4DIPEJdiWph8z29nvpxuvNB/XXAy4hdeA5UiYTVRF6mu8IUbMd/WvhcNUjYt3QRZcMcXQxiu/8ZNjIMMmaO/H2I0b3DPPmIEcc0x5qZJ/m4qmaU6lahzQ+HgrWOez9qkUJWyF3M8fL58SiNny57UbZNdbSpSIBJiAyHejEc3cXZwHaaA+90l1WK6dRJWUblHvsJWkiBh1uMCuCQtbk+ySmlfUcDf5mjJs1tTsEBOfDm0gOCUMeaIjrR1E+dhq6Et8+XTfVLPuJ9Ecnwc968xbLD0A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR04MB7158.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(39860400002)(366004)(136003)(346002)(6916009)(2906002)(478600001)(5660300002)(8936002)(2616005)(36756003)(186003)(1076003)(64756008)(66476007)(26005)(15650500001)(38070700005)(38100700002)(71200400001)(6512007)(122000001)(66446008)(86362001)(66556008)(76116006)(83380400001)(4326008)(6486002)(8676002)(6506007)(91956017)(316002)(54906003)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?7wmGab3acS/FcazQCAHeO0v?= =?iso-8859-1?q?el5rMHf1/NCNMnXqvw7xBoNKCWgmZecHxeeuWTZx1vob9dzNmqovgUUiZ09/?= =?iso-8859-1?q?/ZD/9Cp421LixBFXvQ/HEwKVY5HsgqMcTmVZ0e6W4f0RuoTSoBA2Cf6ynTEm?= =?iso-8859-1?q?1n41Oi0PV8G7Mw4s9GSHNv2rIqaIV/52WiEXAOjn2J+HesHU1vblM8IR0WBW?= =?iso-8859-1?q?sEk2RMkZFsMJXLdK6qufZKby8SVN3Jfg++EFGQi8zOFPIglcmqr54MDKpGPg?= =?iso-8859-1?q?Pihrayn15mlgLrbcTEnRsaREmuLlfvE3ePnSIlOMJWy/FFk8EPKwCMBSTj3y?= =?iso-8859-1?q?IP74qOFuQQ40yRodrDovC4wi5GU+AhrZpIh8GfcNk4+p0877JrTs15MM53Nz?= =?iso-8859-1?q?o2/nk9jiEMwOEOXFN++25ZiVtNwsWMh1B1pHLkH6tqImljRHwQWd9cdTSmF1?= =?iso-8859-1?q?jujPvIIocx3lLdQGq9ODF+kMVKgD2FYPFwJayFcwSi8qB5c29enBfqufxU3n?= =?iso-8859-1?q?wVwWyoeoPMEbtWTnK0jFcPkaY0Mh1OF3SYuHXQ9IkRFSUvNkA+T7b+rMR7Yi?= =?iso-8859-1?q?XS8mklP7QYCzSraAq+O1e440OlZO7NU3JUwrFhce02tP7L3xd/fRSojQM+kE?= =?iso-8859-1?q?dW1AO2+zDlReclfUi/OdbvkWjZ1obkqJosttPWWerSfczPxBBMHjXHvF4Sh2?= =?iso-8859-1?q?ROgC2INYz+4SvbBK+/UYTuto2ML0CATKDuN0/8DRrDLVxsUB5Lp805OVqGwi?= =?iso-8859-1?q?1EMf+YlwCdiicIONmYJ6NjH5j92CuPifKMe6MH9l/cSEXrFQZSBYxIYLG8Hn?= =?iso-8859-1?q?1vYqxBiTNjwtM38ihLPmI2j0R/ApF6S68W9PnNLAxUiSaIsnzLK1tYSlkAM1?= =?iso-8859-1?q?EtEXsNtBg9Z/2qUMGXJUZzGu2r2RY6hj7JyFWqulkZ0JaPHkWv26Yrg6UKmW?= =?iso-8859-1?q?BHIDm27KAp2+OfcbEenRyOp47WKNs5mL2glVuZaNz2Xt0lDAnAQ8IFeoNqPw?= =?iso-8859-1?q?hbvr9p5Mc7to5jzf4C3WZvGJRzzw0InefGdW4r9Dd31ER1HHG5rh5/D2vYH5?= =?iso-8859-1?q?X58Qo9WJ4a+WwqxEQfFIrZXVj//p93ENophMlUQUuQKpA10BFnNRVU9sXIf7?= =?iso-8859-1?q?wJOHuchrE1Y8t4qov1monX5Hdwa27I7fZpAxI9pg66bTbFY/hr/qt4/aJP8I?= =?iso-8859-1?q?ydAyenOy3NMmX7S8eKBmUYSzHX7XA2W0ADBcu/Db4d64BxMmI9qJumetLpn5?= =?iso-8859-1?q?KzmNjTnZ6bHpnirK3sYXFUlBuPVwqZkmJKMNVuoQKCfQxJC8LmquJ5nAr9g2?= =?iso-8859-1?q?AiWmKBa2vIVOTtI2Xc8Q7LgoGZ9w2dhODwdpRsJHVCSS3JMV+POwWCLLkAgi?= =?iso-8859-1?q?Jlaj5xAMXnd3yD7ksurPAmA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR04MB7158.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88aa69fe-3444-42e0-55b5-08d9720ad8c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2021 14:21:56.0407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 37cK5aB6Ga1Ajwvf+oMkoTTD9RqgU3FFAg2izBHGNygok0pdiTW9ZxWQLpuCKr9XG1YDGDtERmv9Qt7LCXJQeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR04MB7382 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Niklas Cassel This reverts commit b6d2b054e8baaee53fd2d4854c63cbf0f2c6262a. blk-mq will no longer call the I/O scheduler .finish_request() callback for requests that were never inserted to the I/O scheduler. Therefore, we can remove the logic inside mq-deadline that was added to workaround the (no longer existing) quirky behavior of blk-mq. Signed-off-by: Niklas Cassel --- block/mq-deadline.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/block/mq-deadline.c b/block/mq-deadline.c index 7f3c3932b723..b2d1e3adcb39 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -678,7 +678,6 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, prio = ioprio_class_to_prio[ioprio_class]; dd_count(dd, inserted, prio); - rq->elv.priv[0] = (void *)(uintptr_t)1; if (blk_mq_sched_try_insert_merge(q, rq, &free)) { blk_mq_free_requests(&free); @@ -727,10 +726,12 @@ static void dd_insert_requests(struct blk_mq_hw_ctx *hctx, spin_unlock(&dd->lock); } -/* Callback from inside blk_mq_rq_ctx_init(). */ +/* + * Nothing to do here. This is defined only to ensure that .finish_request + * method is called upon request completion. + */ static void dd_prepare_request(struct request *rq) { - rq->elv.priv[0] = NULL; } /* @@ -757,14 +758,7 @@ static void dd_finish_request(struct request *rq) const enum dd_prio prio = ioprio_class_to_prio[ioprio_class]; struct dd_per_prio *per_prio = &dd->per_prio[prio]; - /* - * The block layer core may call dd_finish_request() without having - * called dd_insert_requests(). Hence only update statistics for - * requests for which dd_insert_requests() has been called. See also - * blk_mq_request_bypass_insert(). - */ - if (rq->elv.priv[0]) - dd_count(dd, completed, prio); + dd_count(dd, completed, prio); if (blk_queue_is_zoned(q)) { unsigned long flags;