Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754650AbcJMXCH (ORCPT ); Thu, 13 Oct 2016 19:02:07 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:14539 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbcJMXB4 (ORCPT ); Thu, 13 Oct 2016 19:01:56 -0400 X-IronPort-AV: E=Sophos;i="5.31,490,1473091200"; d="scan'";a="25178920" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Adam.Manzanares@wdc.com; From: Adam Manzanares To: , , , , , , , , , , CC: , , , , , Adam Manzanares Subject: [PATCH v5 0/4] Enabling ATA Command Priorities Date: Thu, 13 Oct 2016 16:00:27 -0700 Message-ID: <1476399631-5799-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: BY1PR13CA0002.namprd13.prod.outlook.com (10.162.107.140) To BLUPR0401MB1713.namprd04.prod.outlook.com (10.162.215.15) X-MS-Office365-Filtering-Correlation-Id: 07c2727e-aec3-4bd0-974d-08d3f3bcc50c X-Microsoft-Exchange-Diagnostics: 1;BLUPR0401MB1713;2:lPbu/tSS1Z6Vm3rXjCMliGEC9qFSQRtCnkOgdm8kEvm3bpX8QwSgq7FpEb+rZU1naKX+6Jt3ctuorce4SEbHPvHAliq2cyBhXX0BkVDotpOLMhjsjfxp7oSnozHSwIyPYc9GUskASVkLUntZ+KgcLJ3Ar9ti8wHids8uno/7FTLabsb1pUuA+ZNVogUTVPo9L9CN+PRJgXypwC7jwupmOA==;3:z3WK9jpCUJPmsJRqVdqQQfcidl+paaDwv7yIWUgqbanxhQsThv8cbucflnZfTRNW3SBbxeEB260HTjxJ8dimFxiMvBGh+mpkKqHuTkEaAl9VcRHXNtix7sWJ6xt7N1CQ5qgEl0UbdVrHitHOY55nDw== X-Microsoft-Antispam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joPRb9uVxd93Ph7zKynsxasSdq2HDuKpQEN9KPap5tb3DCHiiwV6DChVzTPljF3z12SOiKUaNFP/87AdPbUcl+Fw=;20:Va5DwfyxCY5Sm7Jm9h2dFmmNbPIW6zM3OZ0Fcj3dmOm+naE44HZO+lIwXE12O0EhHNBJnUhhc39iE9lsoaCIEhVNoEO8CRAzFeVF+W1t9tBVhyneJ7eIYq2UFPQCgU943Z2Jk9MTbk/2zRzCJ3vlUCUYlOx/J35JfTjl0vgSZvz5KEe1I4wLmBCEV68pkN/62mUiO57euRCUq2ciUXbvCWwdFVWx2sPYlcaLqsyZnjI04eZ5TniK04Ch4un9lRDMs3p1bhMfL73GA/xJhnw+TUJ4LFITi4Cp0No5qFEYPkARvYGpEpp6nQZs8O+s2p7BH/1f0sjjxWda2GcmmerqDEw4q6gSQjP7XlFn92X6pJJ4CKUPAJoRc26pWGukJcgu0vVnENfvmbF3AX/aLI0rrJ4wpqFpUGH5seBUz5ZFxGkgtz8B/WOPU4cFVykyd78evh3rqV/neJUylw98IwIQGfJ7xNQNvoukLYwjDXDdIiV7OwQEJ+2G6vKkcSe9bYC7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:BLUPR0401MB1713;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0401MB1713; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0401MB1713;4:KWx1/6E+GpJhGP/QsaJLMboWy1tMe5VY205o1W2cw3zE7ODZhDGB3g8EEBgLhg3ojsab4LtODSSTsSiFB/ba5mw4gfhkwIZHqAuJIyNDRQDTJd35zjwIQeS7s0hK16dC7CqS/23WAjxShq59UN9MVsfLVnsZFrW9tNOAvun/d7Jn3MIRldGXYhJALEtXreAyNgcwm9X8W0G9rFX0RHdlKIBWXTEQoEiQr+LAjv+zdYtgcRTgyE1TpMU40OqAq0Vr9BYsDxoHzukJkPzDeOvV0R4fVRIBAyKcyB7siWxtsqMKXr1mS9vGj31otimMo2uwI36Snhwstpzpgkewmdsrfcvf0HQqzK0UVrR9Gla9N61o4IOeqT59CFz+NJuQkEibi8oerkqUZnUGmw6rwkgbHjbAyEQ1hsdcbM3KnM5zMwc= X-Forefront-PRVS: 0094E3478A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(92566002)(4326007)(42882006)(7416002)(3846002)(36756003)(106356001)(7846002)(305945005)(6116002)(2906002)(50226002)(97736004)(105586002)(47776003)(2201001)(48376002)(33646002)(586003)(7736002)(66066001)(107886002)(6666003)(42186005)(5003940100001)(189998001)(50466002)(4001430100002)(77096005)(229853001)(5001770100001)(68736007)(50986999)(5660300001)(8676002)(81166006)(81156014)(101416001)(7099028)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0401MB1713;H:penguito.sanjose.hgst.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0401MB1713;23:qlygM30o87jdhtLKXoVZo5ul4zmDwGCHU3U4kUK?= =?us-ascii?Q?AlxKeJuENGiA/hSLBPeh+I32eDkigClvhnYOn+i0Ujdtmw6VFeQydVr58IY2?= =?us-ascii?Q?REzcxkAWl53ypLWOGrCJCLD/QwAkE9BKkMOS5oB+RK65oWnWLTh91qHSvKOL?= =?us-ascii?Q?mdA3toRYsicXzzk7AfOKUdXz3lPuyRZAiVmhBgPU4Kw1VMGB2eDYXbmohOjl?= =?us-ascii?Q?h2F1RInt182Jnqzqjlq0Qsh8jgfFw1aN3drPQZhLulu7SN6n7iw8AKs5Sez0?= =?us-ascii?Q?L0hWNCncEatpL67s7sgJUCihjggB1hSPZcvrJGp30FOsxOjozgJH7vd1osXF?= =?us-ascii?Q?nK0uavhQgh5DAqPmisO2OBKJsn5etPD0k8mX9LHQYrD/wpmMhTSe3JjzPDbe?= =?us-ascii?Q?XOOTUVDupiv2ZTjdErx66iZXmuKrEq18M3GNQX/gFSKFFXH1qmburkSVb0so?= =?us-ascii?Q?9E2puoNuKSO1vArnJ6m3EHm1RXolgDKU6Uy3CulYsUMaiCOVe3CMpNlhWsxJ?= =?us-ascii?Q?O1fuMCQcgHnUFH9RQ5deZzMjOxa/Zti3t1l2pQD/clEDuz5oxV0w50brENln?= =?us-ascii?Q?+FFOogphTrPEhD/kRtnOJpcsqs6rLf0EPFiLOJF4UArFNOkzEsVz2bXH7tdE?= =?us-ascii?Q?qid1bNYR6hNdsA/KUhKpsWIt3YhUvqi54bVbiZokMe+7KCYaetP+zRoigsyP?= =?us-ascii?Q?Gw75nO15HZl4wIbqOebyJbFEGOhIGMdZPCHD+XJs8kGCDxWyp8iy0rNSp76o?= =?us-ascii?Q?u4PeKWxAmvIrRB+SRcKxTZm4UW/0uiwGBibwRul8FfKl7dOg7Y+QaGPYeYIL?= =?us-ascii?Q?AwPanSJWvAgSMiZbv7ktgWhRiKNf6aXGvp762BN80Celi2IjGd5gnc2ULhP5?= =?us-ascii?Q?sDeG9Vej2ZyuR1XpIsbAF4b3/X42OtWjwLkf4EnGBo6Njzud9/tddcG3vy23?= =?us-ascii?Q?/eZybC+q6wfOXHBhD8IobEy7WTqeyc79MpN0+4ryvZUkqKUv+r0PQE4gSHmp?= =?us-ascii?Q?Hxd0eZd6AvOKPPPtyzFWG79iz+pc9Q0aMhajhtWtnwcVVACAHE8+2aj9R5rA?= =?us-ascii?Q?DXyfoS1Z8IOzfNXQt8ilZan1VXXsvilqGMRiliPUz8nv6W5IWune22HDtp8O?= =?us-ascii?Q?dGf50tTIzqcotXe+0BV4HbmBgYY+blprHjI4zqZJsSV0Q6+CNyo9SIw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0401MB1713;6:lHGq/wkwG25bVzQL46Az+lfpicR4LW8qeL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demlw0eN0sDqOYGblkq4xMNmux0uqJXeTCPPSBHAGLYH8Q4wsfP2CXoJLROUoENDBv56BgqhguyoksCEbPNjLX2LYiqcgpTIJ0jnWi3o4j8azTNpp7Q8uTu5Nbfvl1FwPUNyWMVoc7/6zJURFqDOjSyukHXJ+vcEqC+Lbs1S9TRd0fqUJUmit/1d3MQiDy+o/fDm/QOpxX6zxlLg4N+Z9+Gjk0HqVJpmrOcXA0z40HNtCim5GEOu X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2016 23:00:46.0757 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0401MB1713 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2427 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 enable_prio device attribute to 1. An ATA device is also checked to see if the device supports per command priority. v5: - Updated block patch commit message to explain the why 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 - Removed queue flag used to enable prio - 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