From patchwork Wed Apr 19 21:01:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9688947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE5A1602DC for ; Wed, 19 Apr 2017 21:01:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F9E428437 for ; Wed, 19 Apr 2017 21:01:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9472328447; Wed, 19 Apr 2017 21:01:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 538FE28437 for ; Wed, 19 Apr 2017 21:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966135AbdDSVBq (ORCPT ); Wed, 19 Apr 2017 17:01:46 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:37207 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966136AbdDSVBl (ORCPT ); Wed, 19 Apr 2017 17:01:41 -0400 X-IronPort-AV: E=Sophos;i="5.37,222,1488816000"; d="scan'208";a="12353960" Received: from mail-co1nam03lp0023.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.23]) by ob1.hgst.iphmx.com with ESMTP; 20 Apr 2017 05:01:40 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DtkJ2X3+K95isjCAUfduqjiIEHgAIef1+hdK3zda/f0=; b=KQJG7hWW+HVFnt8Gt5DXKmpY1nl6i3/VMld2b5CbfNbvE7xBDcqudL2plnmXGOapiU0oP6gEq7NUYarQgy5YRh1hesoOt0y3eOpTRbRVRlpeQ/e7GbrARGDtaqNUa+GXJNYjHJFN6x24gCiN5VwwfqY+Gf7TFPFfxxh2zZOM/xk= Received: from BN6PR04CA0016.namprd04.prod.outlook.com (10.172.194.26) by CO2PR04MB2231.namprd04.prod.outlook.com (10.166.94.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Wed, 19 Apr 2017 21:01:38 +0000 Received: from BN3NAM04FT047.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::205) by BN6PR04CA0016.outlook.office365.com (2603:10b6:404:cb::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13 via Frontend Transport; Wed, 19 Apr 2017 21:01:37 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; kernel.dk; dkim=none (message not signed) header.d=none;kernel.dk; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN3NAM04FT047.mail.protection.outlook.com (10.152.92.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1019.14 via Frontend Transport; Wed, 19 Apr 2017 21:01:37 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 25.CC.19026.F20D7F85; Wed, 19 Apr 2017 14:01:35 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Wed, 19 Apr 2017 14:01:31 -0700 X-AuditID: 0ac94371-41ba798000004a52-34-58f7d02ff556 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 30.4F.11415.B20D7F85; Wed, 19 Apr 2017 14:01:31 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Bart Van Assche , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH v2 5/5] block: Optimize ioprio_best() Date: Wed, 19 Apr 2017 14:01:28 -0700 Message-ID: <20170419210128.28374-6-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170419210128.28374-1-bart.vanassche@sandisk.com> References: <20170419210128.28374-1-bart.vanassche@sandisk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsXCddJ5ka7+he8RBjuf2FisvtvPZrH3lrbF 898xDsweHce6GT0uny31+LxJLoA5issmJTUnsyy1SN8ugStj8o5LzAVHuSruTeplbWB8xdHF yMkhIWAicfTHGVYQW0hgKZPE7j3iXYxcQPY2RolTk1+zwxRd2HORBSKxmVFiT8dcZpAEm4CR xLf3M1lAbBEBBYme3yvZQIqYBdoZJdZ33ALrFhYwlXjdeJsNxGYRUJX4+uUKI4jNK2Av8ejI AiaIDfISZ7fsBBvKKeAg8fHmTWaIk+wl+udMYoKoF5Q4OfMJ2DJmAU2J1u2/2SFseYnmrbOZ QRZLCCxjlbj+r5cdolld4uSS+UwTGIV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Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39410400002)(39840400002)(39400400002)(39860400002)(39450400003)(2980300002)(438002)(199003)(189002)(9170700003)(53936002)(106466001)(8936002)(50226002)(86362001)(6916009)(2870700001)(2906002)(189998001)(5660300001)(1076002)(77096006)(33646002)(305945005)(110136004)(50986999)(38730400002)(2950100002)(8676002)(76176999)(81166006)(23676002)(47776003)(54906002)(5820100001)(50466002)(36756003)(356003)(4326008)(6666003); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR04MB2231; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT047; 1:U2m+1IYJmui1WtP0bMtt8boiW/2ZAc6lbwtp0pwQ9CNGOXIDge/38ZVDT651DdKGsIambxaf6qdGwguJYrtmVnrL7yvN3lHiLUM79bg9rT1fSTED/a1oeHnxGui0W6Crepz2T1J+KauXPxNjcXnn/WWveX961oWP44FpKDCBB1uUtJQTrTw0KTk1Dzep7HlCho9nNPMRQWUM9oh9VR5l4xTQnt7OKu5ohVMHEihALQRRgU8Aq9wnEYTM+LLuM7wCwGJyVeOAPIejO9yIbVuBVGu2ARQMR5JdObyHOZKsylF/6BUgQls2F5PlbHCMea+SlGWfXMl9TTHiD/bhKf31sJXd9t3EQKh4B4IM9jFZFhznniEcNAelgn2YUXnXnezI2aHCdsEa8jXPTloilNNUEwoJgOL5Jrz2V3a8Q7i5GUnH4ZG8jVbdGPKYRIUi27SpiEhNAMeHasUocCGS8Ylqp6uvfb9xeh8t/WyQbgB9pK4C3rLCeOoW/8Loi0EZjb13 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e1d250d-87b0-4615-9504-08d487674544 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR: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:02LUnl7JaEfa845V1uShMBn5T+x4QdWlGH85mrGC7RcAR1gFL+m3lIODdLfdLucR/+nsvuUJg3tY8SFldcGMir8YZyF357juRwhqH2kQJgzSN8MPnQ7KxX5bAmzvttLROSzeinj8JPYIDEVnkY+vP5ftO8lp7aJXVU8XX8PxafV9S/jDOC6kxv4rw64cveFDZ9ZL2kZK+VuvIChkNPK76N2mYyFc/cURxkwFAoGecVg9Ee4CFZpNXF0kNFL4Mp6mkyILqMmlWhL0deWNqneXjsOlLjz6ifbyY4vq/NJz98c= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; CO2PR04MB2231; 20:dq3HLARERXZ3swvPqkyWh00TyqZ4A4EYzx2xsCu98wtCR5RHxKXCJ2dpPV3is32Zy80VlDvAOHPhvEVpN/T844kvJ2Ln5tmj3lYaJVBjplN+i3Sr2fa8ojFLdoz2J1dIn7W6iuPX49HN3Kg8++orVKjt9j9iU0nH0R4ko/Q7YcyQ6sDOPuCzjZFdl/4/+N8XHPhOtz/DER9QBQojU/F88Vexw5Z9OXxh9j1blGW57qaMNLea3X0NBl2cg8NYJD8TlNyNfJW95UNjQSU/gtThGHCSM8F5SB9SR2qY5C5d4SQb5m6Llk47QCso1aLEUMtK4zyyFqSKZfF+L1rzff+qvUtzXDeBHScWlX/SFwKlvHnZ+UVmb3bTk+X0RR6AydksKdJCi1WFmVyhGf3aIz1Tid4KzR/Blrj+dFi+5YX3+gaaNNMyQFUXTMOuTLIQqCqswN2btzIubCFY8SPwJzaF2Dl+ZzPnyxMp10CB8TiJhz6mvEo5uQm/UaKvNarUM3e9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(93006095)(93004095)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:CO2PR04MB2231; BCL:0; PCL:0; RULEID:; SRVR:CO2PR04MB2231; X-Microsoft-Exchange-Diagnostics: 1; CO2PR04MB2231; 4:g3f5WTEaiiTBdM11299IRv3Xo3f1dwMicAdsrSlfe0KQvxvDWjCXJ7aVcHwr5nE8Juosy+HmZmxh/hd2y+0oNjQ2oMbMl0fffi0yLmusWKZJw4+TsvofV7m2gI2z55cHwX2Yieo3H12Cqc3/3CDcprj1WKH/e4n7Envy915jGfLbiPpIINzsR8LWEX4kQTViYG0MHcdIcnHsCw5sK8czmMV1fZWa45GmSMi5DmV7yMP+342J+gdluD8jEJVE5cqinkPuOEge4ULX6MgFer+ogqKl9SfQskj/OMdvSqhh3EPUC74ubW0xLZAEWJ7h4pKgpss9zTDTdv5N5wNm33mCVykc+AC2CbEEwKnIRkJb4qLsWgjSyFSCe734JlcDj8N/3BCXFpv1S3Z27x28ZaDrth3S78AMg5BkDw3OicEbErFvuaeVOzLnKLGNR14mf2f06npOpA7RJO9VqNS3ZsgpWQYoVsH+IXK0ti2s7rGwCslYW8a/jUs+k4TC31Xes9np2bnGGYrwnccJNZWNE7MJMXzAR87QbJJ0LWMusx5IP92azT55VY2Ta0TB1CAicqWarrXAm4CPqHDS4fllxFrTI6o4i7tBG/KOBtOZ0VK+M36dHOxU3zeGLLvRmwyDY269+DYcc3fua9pgbaKB25drpym8lWMZOxnDYgrbF9Av9LSVFzY+p29aB+IrR59UxB1DMqy9s96iqwP2HasXMtCZ3tyisveSoWUSkzHoU+z9O0mt8gBHmNmd82wXe6k+ytc9tqkYFL0zK77F2fMZIO+I/F51h2aVp5raA0cB5InVa4mF2o02cSDXANKwQvCly5Tv X-Forefront-PRVS: 028256169F X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDTzJQUjA0TUIyMjMxOzIzOjZWUjBtU0xMbVpjMFkzVXB5c01jeld4bmt2?= =?utf-8?B?RFFLM05tVnMrb2loV2x4ZmQwRCtsM1NTOTg3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5:wwqhk9Q4M/sNX6sSFTFrgpRcy2tI8b/tKjldxZ1VZtceSLPYvbR1LywU2hP2vkRbTBYIvCh9/2VJWyE5y5nO5TM5/E6g1X5OsagFJWELNeq1QBKSEcXthr6VX548Z7f0WqPcDAa6MCY+gshQtoI3EA==; 24:QfJSUciLJHJzgZsOaM51OegNF8uYERAHzsmo08wZ8nflnv4Lvl/kcQlDND2x1plK7F9AUymMzqVen7dYffkIDNj3Fw/tjU7qWPurQJ2QVAk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR04MB2231; 7:qzfPGMLmnILnJmcoIGdl4Q6LuhHahzuUQAoEQXfws9czWrgbZCKzwrNUUpNtUyazyA+cT/EnA7tVIyTZB+zYNz64+seI/eAYm7mON20Wicfv5WAWldc3CODjEk7h/SGOpevtRUkIEEa2TS5ijKnwmgEfaKWlR1YUl/4CmBsxbyv3zDXFB6JT0oUvjMcfpqe6gsPOWXZcwYFGe6hZVLlcfXJzjytwOm1NgRX7I4vmCFzE4qq3E7P1oZGhKpQj+UiXgMUrT09X2iS0r7Fu7WZNqGKyUs+9LcAn/ZaYNCzDZaU3PPZS7fe0BSXOoWgPmxo1hAI62SZP0xQD/dB1f95zcw==; 20:O/4S1R/SVndLNC8DopBp7UOXJp16VgCma0kxECZWBAqic5MXQEj5sy8nyhAKQor9gYEKJUGDnMhpG1RK9h41V7u9uZWDLmOL30eF35hl79WyoaMjXqnk3+18u1PshKcV7GwVFVirJ3cTOQKIA0/4zPVL1zHfx52Kw5IO/NbBydU= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2017 21:01:37.5992 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR04MB2231 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since ioprio_best() translates IOPRIO_CLASS_NONE into IOPRIO_CLASS_BE and since lower numerical priority values represent a higher priority a simple numerical comparison is sufficient. Signed-off-by: Bart Van Assche Reviewed-by: Adam Manzanares Tested-by: Adam Manzanares Reviewed-by: Christoph Hellwig Cc: Matias Bjørling --- block/ioprio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/block/ioprio.c b/block/ioprio.c index 0c47a00f92a8..4b120c9cf7e8 100644 --- a/block/ioprio.c +++ b/block/ioprio.c @@ -163,22 +163,12 @@ static int get_task_ioprio(struct task_struct *p) int ioprio_best(unsigned short aprio, unsigned short bprio) { - unsigned short aclass; - unsigned short bclass; - if (!ioprio_valid(aprio)) aprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM); if (!ioprio_valid(bprio)) bprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM); - aclass = IOPRIO_PRIO_CLASS(aprio); - bclass = IOPRIO_PRIO_CLASS(bprio); - if (aclass == bclass) - return min(aprio, bprio); - if (aclass > bclass) - return bprio; - else - return aprio; + return min(aprio, bprio); } SYSCALL_DEFINE2(ioprio_get, int, which, int, who)