Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758304AbcJQS1v (ORCPT ); Mon, 17 Oct 2016 14:27:51 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:40795 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758189AbcJQS1r (ORCPT ); Mon, 17 Oct 2016 14:27:47 -0400 X-IronPort-AV: E=Sophos;i="5.31,358,1473091200"; d="scan'208";a="25774209" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Adam.Manzanares@wdc.com; From: Adam Manzanares To: , , , , , , , , , , CC: , , , , , Adam Manzanares Subject: [PATCH v6 0/3] Enabling ATA Command Priorities Date: Mon, 17 Oct 2016 11:27:27 -0700 Message-ID: <1476728850-2309-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: CY1PR21CA0045.namprd21.prod.outlook.com (10.163.250.141) To SN1PR0401MB1728.namprd04.prod.outlook.com (10.162.131.18) X-MS-Office365-Filtering-Correlation-Id: a6f4a465-712d-4a66-fe9a-08d3f6bb49ad X-Microsoft-Exchange-Diagnostics: 1;SN1PR0401MB1728;2:8luzrAyH4PzNZ0mFYcbz8vaImuGatsFZwMjDfJWmoHu3K0ZRIj9pi9NoQs7mFh5oGCvLRyjnt90qMUFftpAR1lqtJ7j16iIDfCONYhtCFvhEIY3pgDCLmyFBZA0N7M5P0cWOQa6q/bEE8qUgdh1OSoPWTI3GeRlSuEIyh7rhBi84CwZB7OGn3E/194FqQzV3KuJfc7snxC5ePcs29YwQeA==;3:SrTdEpQ+5f7ikoKzI2syoYLYU2wvF1TohPhRsrYF2OQY2bdrjfJ/LfNk3Sa3+ix5ctrHR5xnnrihZcrOqIHt2qLhZ+iv+CI1/9m48VDaVn8bMgH5KjzuaHuBR95iJhW4FyelFTpIKgXpx4FPJBCzNg== X-Micro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29/V2a5KVHWGDMKbEFJftQKNbvdvoYM0lT4p9t0UXqJ;20:5KcHBK9I4k6nIZxeGorIIzMeWP9XQRc1cUI30yKiZaUsUWPJyhiiw8IzeImQAKyjQiH+TvSnQAMP6aOxpni/lhRta7p6uRHtUh9DuzVmAXArTdXuyi5KeuX6UkLf4ETN89nZB/8WHR9oNnfJTMjT//HPkBH3p6JeYQYCbIJejzORYBQsvAOkt+/fVon0oaX0KHeI+cQu63gD5UNE/0N3aRwN8E3IYbQxvfmdcPEPmGG4ER0CD3pS6ZtgTDS11P6xbLetuskJsKc3t1jetJYNFKVIX1XlmhSE8U4YZLUuzqkk5CaDg+v6N7PwjSKK5Nx1fQdg2bX3TF0rDNEB83TssQn5U8viFHXHOOVN72e1+w0bLmasN7tfurXKh8j0aERdo3pOkdTdHIkb6IOsaeLAyBECgjWGGmVfrtdDTFiM6P2ndehClmll53eIcWaGm43WsYZEboWzyIgRw2Vij1IJagyfx7zbs2tA+bH8Id07nflNMrv94b21uTEH5iBFMeGV 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:SN1PR0401MB1728;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0401MB1728; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0401MB1728;4:W8pUJAq2v/44gWcCLKi1siw0t3WstHnzI9FFmTZd0YLaa4QDtHt416rleY76VZuMdrFtk9Aw6kqigGix9Prbz4y215CJ0QiJbNSPCLk8kYq+KWKaYW6ozYnf5LHlDFBBAd+EkMgwwBneSCY4uINQi1iQKzWUiLxnT5DYrPGH+gsL1L4K91z1VJuztWgXD6tiksgE3cPg/YqJSaqzU9yhXx3htxH3TKymhDEvaqhxaWtbybnQTNeCIRhE82JafTAxX+3DynOQoTKIbBC2TESwjFAxv5HkpLs0DRwic+cmvL67Jv/MgobkvQlNp9pq6aT0bI2uXllead+X2CZBa3iDUlXf/+7aM4QI2ctAZEsN9YxlHEGUZXNT6FK3fOXxm0ZVw2hbjxsR+YKInJnRXeXBDsUglWacdQ80KxHK0SNbx9M= X-Forefront-PRVS: 0098BA6C6C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(5001770100001)(6116002)(77096005)(8676002)(97736004)(305945005)(6666003)(7846002)(7736002)(81156014)(7416002)(3846002)(81166006)(5003940100001)(66066001)(107886002)(586003)(189998001)(4326007)(92566002)(36756003)(4001430100002)(50986999)(42186005)(105586002)(106356001)(5660300001)(50226002)(47776003)(229853001)(2906002)(68736007)(48376002)(2201001)(42882006)(33646002)(101416001)(50466002)(7099028)(921003)(2101003)(83996005)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0401MB1728;H:penguito.sanjose.hgst.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0401MB1728;23:EDeTPCcJn/GqGU/lOENs23LjLVcZ7bzT2pAtHap?= =?us-ascii?Q?X27l4L0aVfZoeluwz3ITkzcQn0bpJgfOrzg3tLbpJrcqAf2P3QW+rPBiNdjQ?= =?us-ascii?Q?7v0C7TXkPgM++hD/BOUbCJEb7k34TK8nGJK6rW9puYQzGqhed373/flIN3tD?= =?us-ascii?Q?dnKgAM/Wa2LKpE/9+JnAKRirXWrNsBR9viEyIBG2aBMTXHHMj5Ue3ak2mNVB?= =?us-ascii?Q?9srDAhdrkVL82Ijaep0EE6pI8lN8YyWqHHBkumTpOLGoOe4i9SBHap6xYAPM?= =?us-ascii?Q?4ZML3JSOY0SZcbnoZlVMBevNX1gQ+8jplsbVjWp+w9OdfLt5evO2pvBJ0Arx?= =?us-ascii?Q?XeTiByvavHA7Ocbdfrn79vD/j2J8ucF7PKoQCF797GgnVWjnJqqwGQms6TlF?= =?us-ascii?Q?475UaX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7uaCIxekNuCCS/XhjvVkbc1gjk7vSlinuDM70m8qAShgEBhATuS0auIkSSYlfWiKHYszK8UCIqggjE0yfED2JSDy9UBvfpqjcFa71VQ5GUltpnzirlLe/di7JfmEii1tQXc/eplkpuRqmZx8QuhA09Y1/5lCh9AmxEgGrE9VB6RAM/9Icg9clEvs7vlinQmhRy2Pe1O2wMWBWE/T93 X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2016 18:27:43.3939 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0401MB1728 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2400 Lines: 60 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 requires setting the iocontext ioprio on the request when it 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 ncq_prio_on device attribute to 1. An ATA device is also checked to see if the device supports per command priority. v6: - Removed fusion mpt sas prio related code deletion - Renamed ata device attribute that enables priority cmds to the device v5: - Updated block patch commit message to indicate the why and not the how 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 (3): block: Add iocontext priority to request 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 +- include/linux/ata.h | 6 ++++ include/linux/blkdev.h | 14 +++++++++ include/linux/libata.h | 25 ++++++++++++++++ 8 files changed, 157 insertions(+), 4 deletions(-) -- 2.1.4