Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756428AbcJMT5k (ORCPT ); Thu, 13 Oct 2016 15:57:40 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:18540 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755966AbcJMT5M (ORCPT ); Thu, 13 Oct 2016 15:57:12 -0400 X-IronPort-AV: E=Sophos;i="5.31,489,1473091200"; d="scan'";a="25155207" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Adam.Manzanares@wdc.com; From: Adam Manzanares To: , , , , , , , , , , CC: , , , , , Adam Manzanares Subject: [PATCH v4 0/4] Enabling ATA Command Priorities Date: Thu, 13 Oct 2016 12:53:49 -0700 Message-ID: <1476388433-2539-1-git-send-email-adam.manzanares@hgst.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [199.255.44.173] X-ClientProxiedBy: CY1PR21CA0075.namprd21.prod.outlook.com (10.163.250.171) To BLUPR0401MB1715.namprd04.prod.outlook.com (10.162.215.17) X-MS-Office365-Filtering-Correlation-Id: 5cfafadb-f039-491a-b06b-08d3f3a2aff2 X-Microsoft-Exchange-Diagnostics: 1;BLUPR0401MB1715;2:TEigS4rhVo60F92GNfHA885ef+m9WoFP36H1h6clbnGPdSqT9XDlDXupg+OiVPmOle+ewb7mbjII/+WLb1QC15wa9rnLapHF5idJj2SSS2Q5LZJxXzqCRTEkOJx3NfZ+3tSRMcTvu1Zv4m/jx+lzVAsyvYrFNfUXKN4YxKxN+ThlDD1j9U1lq2cI94OZVg0f3fSt49ujhdSDI4X8tAN1NQ==;3:8HiylZ/v5/74ZwinurRnW3zmWXta8SjISbENfWmbeRTj6TcH9qoxvfWc+0v/OVMWQPdhR0rVbznQRwEvEsYdB88CeXoXc/h/OrHLwCf1dcSLbPHYSN2GZB8L4HlvxHDcJSCha6Ndu3Ih6Tcyda3qkA== X-Microsoft-Antisp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4hCHdsc+hmireLFG6TVqmTReExbIM4Xu8SBuGnEQkB+iSY2fCeZGg==;20:BI6RDZzwHoCop3V7yJo7BsiWlOWiP5xts9LJpswsmCNatHDTsSyAo9b3Hl9B1Z1GxP+bijMfgWfnWdZG4UPwHJJHpYLVuaN7Ne3ko6wSAdiH4sEk3BOBvVoVXuHb6k36SE5WHtNOlKb4HYFEFValxxchfzoudTrpjEUbwCbUhG+8RzDx4rzB2+Q9vmcIOz9daI4HWEVHxEkWoJGy0ClvxVzgXcH3KkSUlaa05aBdirX4XDwgG6W/wb8YIB/l+ta4Kxnjevkwf5N9VaCcbmESev6+cBHhzwtxxZOE5h2+zfCj3qAXQgYmMiZIN2XWrQMMfNz9BNnD7QldvsbeJPbAWVTEiK13WjtZlKPwOfxZTZLcLtedOZeslI92krdMha29MW4aV1gSf+yS24KbMbOz4/9jeU4g6c0JNRgmUH4gsz26HncXQEydXcsqRyoREA0aiINq4VuXO2HhacIfeH0FbZZSVO51GzTN3oqWb7Lb1erUgYRAbFdjb4KrOJ27Dbfc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:BLUPR0401MB1715;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0401MB1715; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0401MB1715;4:mmQVyDUZ5h0gL7IbA8+QPjcOCvdNNTQ3f+TDcZCzPXng6JYa3T/IuBsznXwYy3tAwWlZ/W5TPNtiaQuWn8y1GctMOUsCW4BWGGhNUQ0KH4RnGu3fZwsd3lAVA2/eQlDofTDZ0TfKU/nU5cYuW2imX2rSYt4EQ9d3HwggCxVud+0yqnUUQdcEKzlHmE4tVomm5Oqe400rvvuFPRmofO+uXtcskYUDP0+tvNUnLtdCYVmo9k1Bzn9WuJ5ClWgcI8c9ha4hpEWQ7A0ElVYScUUApTGe4KGA8A66xVrg0Hv4WZ37uFSq4D2XLeJRUZefR1xJ6sHaqRdVwuiGS4hLS9Dk15DHY3k4WUGNO7mdeduxLpb9SVZB7EK/OkTpEZVZUpkusBlA69JnJyg5+c8k0WRATQvePKDphvxer7ZAZoSR+B8= X-Forefront-PRVS: 0094E3478A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(105586002)(189998001)(50466002)(36756003)(101416001)(42186005)(92566002)(6666003)(42882006)(4326007)(33646002)(107886002)(2906002)(2201001)(68736007)(5660300001)(50986999)(48376002)(229853001)(50226002)(6116002)(3846002)(81166006)(81156014)(4001430100002)(305945005)(47776003)(5003940100001)(77096005)(7736002)(7416002)(5001770100001)(7846002)(586003)(8676002)(97736004)(106356001)(66066001)(7099028)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0401MB1715;H:penguito.sanjose.hgst.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0401MB1715;23:edKVg25LE5nnh7f+Cd0tJfFbvpK+q6Qh9wu2biN?= =?us-ascii?Q?B69Gcg3QTGypBnJPkCgpc1/MmgeQpDmrpsSN5xYu2F1/f8R4mB13fm2LnS6Y?= =?us-ascii?Q?/nFwIsOkmtqaCiMQyLoqeU88JeiqOIoVVLDXAzTzOzCCsbJY0/Lyxl0K01Xn?= =?us-ascii?Q?wEp3FnByugGK3xarD8YEm4w2EvUyDr0sF0BtO4vnd50nU8B06j6zCi8tj94Q?= =?us-ascii?Q?BuBqkqDOnxd6l6Lm982Lsbk5cYQDgIUuBLW7P7oGnRMaMxU9SsFtBe3GtZJu?= =?us-ascii?Q?B545WOgLA6F8RYkHfyKz2+Vi1opcyYwBpmrjCqDwlzimzKTmgOm5dFxiPJOK?= =?us-ascii?Q?5cMNH9m9Yhzq847cqcVm8cvyBAEzaPAduKUX6gLSCJZ9fuIOX5128YD05t8A?= =?us-ascii?Q?MLVrt38Ysz/ldzrFVCuTcIDhO96UUyHiwKd+BwK8lZ2571M/jYz4Srbf6g7h?= =?us-ascii?Q?KSuvm9ripKnyExdFCvw2LA4Zpceth74sh1a2own3w/1HuCj/4RbUsaGfDN3u?= =?us-ascii?Q?W2okOU543DuIMSbMnn0jRygSIiIIYxRYGYvSNWDlw2jjrpP/n64rzgmk0Vep?= =?us-ascii?Q?k9+/w1QNEk7eYfPEhiwL01SXRdkg/sq3EeInBQ+zu9KoyQ873vrt4S26fRKF?= =?us-ascii?Q?L+5xo4tPa8CL+JbqPomyd5ZXQiDbH4LVeNH+BcM37AEV0XSTUhn/xH7UDvL7?= =?us-ascii?Q?MnRdWKu/DJdKeukVq5b19ThJsMQAaLB+0wRV+BUf0WcB8dyxEE8QZB4/a9ZS?= =?us-ascii?Q?zR1HKqrC0JVU03dMj6dnTOyygVbrDy1up8Wj7UV+iWjDXp+23A//9ajNrQSy?= =?us-ascii?Q?scwQO989tOiwjz/xaeG9J7DwjfSS3XJykMJFlyoLhbOluctlKFqvU3R7bH9M?= =?us-ascii?Q?Zo7kh24bU8vVg7mEd15K1/h99XyeKQWHiZUvI7Lvil9EyqlUqAnBVyuALodb?= =?us-ascii?Q?0Qg7qMUxTF72uAM/iUFYIcDGoksCm2+HskF4mZYsc72bq/jv6BQRZpkptHFj?= =?us-ascii?Q?s5/wZf5EYBlhsZBoDkOF+aPJP56HzZDgRtoS5r6bfvonQTHw85V1WBSqp9Qd?= =?us-ascii?Q?wG+ukHKC/F9KqsAczoL/m+i+QSOZeeHWEvy80ltZLUpxlVKY5oPUTZcFTVWg?= =?us-ascii?Q?vU3v7/sa8FjQqrOrJvcKT9HwTqGvwXGNDKWRIKlLc/VA2FgsfpBBXLg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0401MB1715;6:foeLonRHjlF6Kpba+ny3D9kWfNHdmQ8Qbf2un/96to6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QOzd2/AHDLQBDQEQ+ZzbW8cHmht1fptT+Ei3tRdSHIjx8+zZPv8pjhQ9pQpUmdlKFq6GzmIllHlnNrVRkIPUxXThc/2A0dQIGEqT177SICu2OigjvzZKVcjLRP/X22v2mv0YNuek5Nv/lUIuFQcfRJwbEI4WIqBj/hAugGo4iHOs7inW0p5CCOxUdPx9qJVSLLrzv1jYAK/YbPuFQd7/XJUbONpwoEkg+p29SWiaUAH X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2016 19:54:03.6540 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0401MB1715 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2330 Lines: 57 This patch builds ATA commands with high priority if the iocontext of a process is set to real time. The goal of the patch is to improve tail latencies of workloads that use higher queue depths. This required setting the iocontext ioprio on the request when the request is initialized. This patch has been tested with an Ultrastar HE8 HDD and cuts the the p99.99 tail latency of foreground IO from 2s down to 72ms when using the deadline scheduler. This patch works independently of the scheduler so it can be used with all of the currently available request based schedulers. Foreground IO, for the previously described results, is an async fio job submitting 4K read requests at a QD of 1 to the HDD. The foreground IO is set with the iopriority class of real time. The background workload is another fio job submitting read requests at a QD of 32 to the same HDD with default iopriority. This feature is enabled for ATA devices by setting the ata enable_prio device attribute to 1. An ATA device is also checked to see if the device supports per command priority. v4: - Added blk_rq_set_prio function to associate request prio with ioc prio - In init_request_from_bio use bio_prio if it is valid - Added ata enable_prio dev attribute to sysfs to enable prioritized commands v3: - Removed null dereference issue in blk-core - Renamed queue sysfs entries for clarity - Added documentation for sysfs queue entry v2: - Add queue flag to set iopriority going to the request - If queue flag set, send iopriority class to ata_build_rw_tf - Remove redundant code in ata_ncq_prio_enabled function. Adam Manzanares (4): block: Add iocontext priority to request fusion: remove iopriority handling ata: Enabling ATA Command Priorities ata: ATA Command Priority Disabled By Default block/blk-core.c | 4 ++- drivers/ata/libahci.c | 1 + drivers/ata/libata-core.c | 35 +++++++++++++++++- drivers/ata/libata-scsi.c | 74 ++++++++++++++++++++++++++++++++++++++- drivers/ata/libata.h | 2 +- drivers/message/fusion/mptscsih.c | 5 --- include/linux/ata.h | 6 ++++ include/linux/blkdev.h | 14 ++++++++ include/linux/libata.h | 26 ++++++++++++++ 9 files changed, 158 insertions(+), 9 deletions(-) -- 2.1.4