Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934173AbcJMWDR (ORCPT ); Thu, 13 Oct 2016 18:03:17 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:9003 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756159AbcJMWDG (ORCPT ); Thu, 13 Oct 2016 18:03:06 -0400 X-IronPort-AV: E=Sophos;i="5.31,490,1473091200"; d="scan'208";a="22020303" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Adam.Manzanares@wdc.com; Date: Thu, 13 Oct 2016 15:02:43 -0700 From: Adam Manzananares To: Jens Axboe CC: Dan Williams , Adam Manzanares , Tejun Heo , Hannes Reinecke , "Martin K. Petersen" , , Toshi Kani , Ming Lei , , , , , IDE/ATA development list , "linux-kernel@vger.kernel.org" , , linux-scsi Subject: Re: [PATCH v4 1/4] block: Add iocontext priority to request Message-ID: <20161013220243.GA2745@hgst.com> References: <1476388433-2539-1-git-send-email-adam.manzanares@hgst.com> <1476388433-2539-2-git-send-email-adam.manzanares@hgst.com> <068e03c4-3558-a6b1-2008-d13bde4958a1@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <068e03c4-3558-a6b1-2008-d13bde4958a1@kernel.dk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [199.255.44.173] X-ClientProxiedBy: CY1PR13CA0103.namprd13.prod.outlook.com (10.164.65.29) To SN1PR0401MB1725.namprd04.prod.outlook.com (10.162.131.15) X-MS-Office365-Filtering-Correlation-Id: 85b33afd-4036-49d0-1610-08d3f3b4afb0 X-Microsoft-Exchange-Diagnostics: 1;SN1PR0401MB1725;2:4CZWKnaGQR7mkyLTNsh0ubhBxXvmVuG0Cu5Koys+Gddx5YbIijcn6YhzAldibz9N/vijXMJiSLUMg/wQXY+AIUdDM7H4rN6sFGeRI10PVBZ+0sdT+qHTpvlxIvlUXvwAz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PP9/HqPvuS85v3qAn X-Microsoft-Exchange-Diagnostics: 1;SN1PR0401MB1725;31:twNq4Dl+hY5LD3kfGAhLQKCGuQPu9BxcAOQR22lClbCIcHHWX8tDs7FfoggEgPhZI06uWHju2VkmeDfqiZ2L4V7XbxXbWCKrMy9bsk0c2XuIc4YLKPyIziUs736wftjIWx+fXZyb15N0GW/arjZrHce85i3POK9R4Bi8yFqTZfq1pgLB11i/kuaWAeQYXfdxVMGAluOdu3Bud+N2GZa8eBifMOhyeGqjKOQ5/OIqxY5PKto0p7IY9pXcpvPZkmn/;20:hioo1kHzZkLY7kgKmdilf2wayIxu8qARrSGKUArCE9TmxwAY9KCxe50mNR7GuRXEYnassYgyX9bNaIH5iCNH08JfzkGeXaHUEm1YVvd5w5ykVhfBhw/lCfq4w3HDRZbMIB2NLNSUdvNMHYT+Gp1XPKayr2GHnixr+WJh+DcsToNBYauXWTYp+9DPfINbBdgrf4xFntISwJ66PPteVdgko9vtRalni+HvcsI4WE2Uo53uvMBG8tCjRUzWjM549agdgctJxAdP2nJSS5iG3yep0hpex/FOlFKi3GKURIx1WFpPGC+eL9lhiyAWegfaeXdojGjFJEJAnXC5oNZeZA6jgNWneLLybLjC4vXZxvl1QgKkajkRVaut6ddjj53yNl3vpupYTc9cMLhER5Xk9zHGNnHbpL8sE0IVYXqvRuCQF0TYID8kkZm0+LJ16KFHl6dSXjfloVnVe5IEIuUoQeY2Q4MW9QqoshYiCfnc/DsuULne/jJmDFEr3fQqhR91jeDW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:SN1PR0401MB1725;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0401MB1725; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0401MB1725;4:i6XcHyGxbSExcdlUl4LRRvfMuIym8tnBcQ+KZL+PhEsjVaemlNVIKVJERrUj/XRftGkuDzkg4/vat/uLUNOinady6U5X5/JG/GU3E5u8Kow/FyriL3ytWtPkTkKZeL4XPhWk+rYVMmxIWK61kexmP1t5Lu1wCGoVDv4qWGAHQLtFVZuh02Ic0XoUkdYq3xsOWHnPXNpC4dfL42AtVD8vOMAZzg7X8qPTS/mffJLF0Rb71ICP0aVoOiW7fke23kDIz3D3CpcovWt8I3qYx66mU+yIwo+QEWaVh3FN1SA9ojJni9QfgD2UC3opjSLfaaZeS5p7k9aDvyVfkvk4m8OZQO5p0L27lKT+u5mTxYNi4Ez7zjhu8EfgwVBEIRLV59XbBOlCIM+UY4Mh9ouAErWNgEMzwtdROnuam7Wk/7sQzq2n3YGkpgBzOtAbnwbj9Ivfa2zUxvohmVdbvhVIni8Ssg== X-Forefront-PRVS: 0094E3478A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(377454003)(24454002)(43544003)(189002)(199003)(83506001)(77096005)(50466002)(86362001)(66066001)(110136003)(23676002)(1076002)(81156014)(81166006)(586003)(6116002)(3846002)(33656002)(7736002)(21086003)(7416002)(47776003)(5660300001)(2950100002)(7846002)(6916009)(6666003)(305945005)(101416001)(54356999)(76176999)(50986999)(189998001)(92566002)(69596002)(19580395003)(4001350100001)(97736004)(9686002)(19580405001)(36756003)(42186005)(4326007)(2906002)(8676002)(105586002)(68736007)(106356001)(93886004)(7099028)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0401MB1725;H:hgst.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjA0MDFNQjE3MjU7MjM6UW9GalR1anh4TEtta1ozZjhzZDZMY1FQ?= =?utf-8?B?V3hhK2FJZmJDcGtOa1dxMHpHc3VER2R3MkpwQVlZTVRINmlTMU5IMHoxU0dY?= =?utf-8?B?L0Q1a092LzN6bldPUWw5a1A0TTdL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ev6915V12SuVzbjDBlBLfE4cfTqHdJ73n5TRXFngbkmcmET6AojcXLiaUoxs9HJ7xVMrq/dxYkNpfGvmRK8ub3IdaW7yBHbwn82MiSCZ0zteolMzmxPkMB3mfyF9nYZKv3IvV5 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2016 22:02:54.2586 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0401MB1725 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2183 Lines: 57 The 10/13/2016 14:09, Jens Axboe wrote: > On 10/13/2016 02:06 PM, Dan Williams wrote: > >On Thu, Oct 13, 2016 at 12:53 PM, Adam Manzanares > > wrote: > >>Patch adds an association between iocontext ioprio and the ioprio of a > >>request. This value is set in blk_rq_set_prio which takes the request and > >>the ioc as arguments. If the ioc is valid in blk_rq_set_prio then the > >>iopriority of the request is set as the iopriority of the ioc. In > >>init_request_from_bio a check is made to see if the ioprio of the bio is > >>valid and if so then the request prio comes from the bio. > >> > >>Signed-off-by: Adam Manzananares > >>--- > >> block/blk-core.c | 4 +++- > >> include/linux/blkdev.h | 14 ++++++++++++++ > >> 2 files changed, 17 insertions(+), 1 deletion(-) > >> > >>diff --git a/block/blk-core.c b/block/blk-core.c > >>index 14d7c07..361b1b9 100644 > >>--- a/block/blk-core.c > >>+++ b/block/blk-core.c > >>@@ -1153,6 +1153,7 @@ static struct request *__get_request(struct request_list *rl, int op, > >> > >> blk_rq_init(q, rq); > >> blk_rq_set_rl(rq, rl); > >>+ blk_rq_set_prio(rq, ioc); > >> req_set_op_attrs(rq, op, op_flags | REQ_ALLOCED); > >> > >> /* init elvpriv */ > >>@@ -1656,7 +1657,8 @@ void init_request_from_bio(struct request *req, struct bio *bio) > >> > >> req->errors = 0; > >> req->__sector = bio->bi_iter.bi_sector; > >>- req->ioprio = bio_prio(bio); > >>+ if (ioprio_valid(bio_prio(bio))) > >>+ req->ioprio = bio_prio(bio); > > > >Should we use ioprio_best() here? If req->ioprio and bio_prio() > >disagree one side has explicitly asked for a higher priority. > > It's a good question - but if priority has been set in the bio, it makes > sense that that would take priority over the general setting for the > task/io context. So I think the patch is correct as-is. > > Adam, you'll want to rewrite the commit message though. A good commit > message should explain WHY the change is made, not detail the code > implementation of it. Got it I'll send something out soon. > > -- > Jens Axboe > Take care, Adam