Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934927AbcLMWVo (ORCPT ); Tue, 13 Dec 2016 17:21:44 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:54745 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbcLMWVm (ORCPT ); Tue, 13 Dec 2016 17:21:42 -0500 Subject: Re: [PATCHSET/RFC v2] blk-mq scheduling framework To: Paolo Valente References: <1481228005-9245-1-git-send-email-axboe@fb.com> <9D1F7CB5-4043-448B-A553-D6A9804D5089@linaro.org> <20161213151739.GA32618@kernel.dk> CC: , Linux-Kernal , From: Jens Axboe Message-ID: Date: Tue, 13 Dec 2016 14:51:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [216.160.245.98] X-ClientProxiedBy: BLUPR17CA0052.namprd17.prod.outlook.com (10.162.85.148) To MWHPR15MB1197.namprd15.prod.outlook.com (10.175.2.139) X-MS-Office365-Filtering-Correlation-Id: d2c86d52-98dd-4b02-3df4-08d423a234d6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR15MB1197; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1197;3:/n/eNAIS4CN+9R7OrbVMmMPBLGn/RGJDRnO3TzskvmbnpQsqoudGR1JYQOOjM2R/YTnkO6X6EDhxL2pTj2zzGslYBocZd1WEr0biHPE0hR6Y15KgyQoGrZzo8ShwXfkrSUhArkEQnHthp6fHgvqA8sbicNINZoKAysws+Wp5TJHJT63xaT18XbqaWLQdtJRbxmPrIlyjqE6U0tQqwB5981vw2l7pHoNOSTsgqBw3/p6OyWAN9Kg4DK2oCPu6tZj2iagIzfUul2YZkWiJIhw0VQ== X-Microsoft-Exchange-Di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Cz9l65LAvgIWYAFAWQXw2jpT6S;20:uATXv0GmqxhqBPw4biG8peI+oW4H2SNnfrsmzx34zCbp2X6/7gryxRNSxreIBxQSWYmgjC8RL5JtBzs9GrohxzKEedvcM0pGUiZGZoUZPIuU6n0vD+DLkTMqFLRO2ff+lENkeik0QLO7zC5qMW3buqYRlPSBUPukDQpp7krtm17IHhKwq5mf5sG6pZrWLjkpONJknzLY+fCzoP+308/+t9BL2mucqK6OIU8qFB+V3f5fuzgcSN7PX5nry5Xa9m3Z+296A65xE8BFR/yhAFMKL8feHDeach/ZtEXm9oLvUJeZDrhy8JSYDtFR6dUqOUxY33uLPsbN3cjAcSBwDNqFWzjfM74jx/9Vez6ExAr2Yo9FSiAY418rYLlDdjt2UAdy8IVmKnGDQziDSzOJZGNOiHak3T065QhEc74J8nI9hEqiMWxMf2+wN+i38iUUMwf/MZ2H3kmBYNfnIpeUQKKt5clA/VHRZ4+9oOJQeOcgt1liKU+IGdrNwOwov/yUe5DB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148);SRVR:MWHPR15MB1197;BCL:0;PCL:0;RULEID:;SRVR:MWHPR15MB1197; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1197;4:5IU/Z6Xra4JTZDvJrqsD53Yx6pHfOWcREmfu8oAKNT0K/YiwV3n47figc5eW7B0V2TU9JFeeQTSLO72R4JpOaoRxfgdQaWPcywIFpNVOP7EVLHLrdb3ExO23obV9qrgQI4SWoy2tgRnS9Hq0h5YiHddn+sMoPQu46tRxJ4xTsHRvOcB4z+dJEvuNegKzl4nRV86iVn8EC/YHH7lJXSKNVcWmlH2IBTttalSNa3jqogq/b69xP9iNgUp4MTdMOR0kgvQYGvll/H/RG+rT5UIoNo5JRq6VxzlHYafaE8Y095WIoufM6oXF0keGnGaVxgTrz+A8XVgWaEWSVGwzrNCKF90ML0yFLC3lksHUjLjiPOw/wA07E2VEyz7TWsJUfZ3ErT8f1UlxTjknfp1EsbvCOiyla0ihL9u8uN/gRc3HN7NNDh84bx9/AtQeaLsSj7zRzNahHsN08YZ0/HVc0CA22nwIxQI2nJO3m9hrPaiwpEuv+SduBPoWfkXRZz/t788Mxs6gz/FCPnL23jGDOP1vgnGtWC467+A0lyfVrDIoIyrlekmxS0l9VVBgF5A91p+e X-Forefront-PRVS: 01559F388D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(39410400002)(39850400002)(39450400003)(39840400002)(189002)(199003)(377454003)(24454002)(65956001)(65806001)(81166006)(31686004)(66066001)(8676002)(305945005)(81156014)(83506001)(6116002)(3846002)(101416001)(42186005)(7736002)(68736007)(6666003)(50466002)(5660300001)(2950100002)(6916009)(2906002)(110136003)(105586002)(4326007)(65826007)(92566002)(106356001)(97736004)(64126003)(117156001)(230700001)(93886004)(33646002)(54356999)(38730400001)(50986999)(31696002)(36756003)(6486002)(23746002)(86362001)(77096006)(76176999)(229853002)(90366009)(4001350100001)(189998001)(47776003);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1197;H:[192.168.1.129];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;MWHPR15MB1197;23:qvkqPnFEWL+DYtXHLB4tbgDyXSqCzakDsSYVz?= =?Windows-1252?Q?wdD60D5x7ZKQdLADU7FCQdspKoX7Pf/7te17KGY4gQM9FeCbYmFSx2ef?= =?Windows-1252?Q?4j1fMobUKFpzEka+625h0c7xMaBlXhMY0P7SWneythjy6e24RPRisjOx?= =?Windows-1252?Q?cPvK+b5ZdORmVyvsLFdnWLKeHf3EbV3IZW3nOAuch3vq6WZMgIzQb7ve?= =?Windows-1252?Q?/j/1gjO04r8ktPSSGkJ9GFDY/HL40A1jL0BqLEUj7MNK3farRONqgDau?= =?Windows-1252?Q?IJzzLZOqgFOz+Xg/+PyJK/yqk+anlRyiBMzGSLdeAGwkxODsNtwJzsyB?= =?Windows-1252?Q?7VRLvNF2O/ZSHIfIPHwl3eFLEjoyoGz2Ck5VuN0e5EeM2DqA/dRamYvc?= =?Windows-1252?Q?IOuQv6SxPaZZe1hIsHIHkxH8L0zwbGjKeQCTqLcpb9f+vfqR4S+rozt7?= =?Windows-1252?Q?f7Pcbb5mqAqCrO0yrJb17/S78MiE40oBJElb2aYugsm2s+sj2l3bSbQv?= =?Windows-1252?Q?3xSYMcXeWxObnwdn4P1+CmmgY6O3m4IsOZvhBaXB8eufazXYjSFBGVQZ?= =?Windows-1252?Q?qqhOU/aov/S/otQTPzIJ5avjzUAbAdbzgxB5w2ItpB/DswctYblDOsvT?= =?Windows-1252?Q?N60SSM6LjRfqNDc0iCTvSe2uCP4sVvXf3yoBhOxexdeAdxYux20GWbjt?= =?Windows-1252?Q?SJ9xXJLU9CDJAiJHQhEV9TkdUe9tIWvy5jwvcfLUQUlEs5QVWJmOkMX7?= =?Windows-1252?Q?8R9Qv9LiBLb3rWzUf5QYtI7ugBW/6cwBUugZG5UutUvDfbeHZoXeTtJI?= =?Windows-1252?Q?vEVTlfAwZak53cVTT1I15A95aNuSqhaYOPIk3jfdJ2wzMoiS5vJwTgpt?= =?Windows-1252?Q?LBZ0An1ULmywACaHeDftzpMZoHbHtZ+1T5qJPYe+El1aTDIb+2v7yNka?= =?Windows-1252?Q?3OgfXWSSRtNU3yUfUnIQPrwE2nSyaYEmgUbFZuRIz7ai/1HOfNqff+yD?= =?Windows-1252?Q?vSInIZ4LdqV/sbCGbxlHqPhTNridosmDTlQgSNNvKA75EpBviOBrLNw4?= =?Windows-1252?Q?Rv06MH0q3NqRAPo6Q2HR5liYNZ0G+WoWojU3yWf+jetFg31toIZfeoOW?= =?Windows-1252?Q?K95tGvzYtBzg8p6G3PIYD9L6n6THc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3Hw9zUlmK+/w5PSvvmDa3c6crJ1yKxog==;24:Z+M8Huh9x1yPZ2GbJomxH81zsVnGcXvU/zxl/kR2QnZE7bkj5jqIN3nUgEU7sM07v1AqD8Bxu21z96bXKiitH4eUypYDy428UH2n+RYYxeA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1197;7:5FLIuBpWaZnzRKfAbzwe4gNlPyZ7WdGbryhThiyOdBbF6DF6SHk3XKX5PgVHIEbwZgn3ORr5R9bLWHk2G139Hw2kg4fejCImDD7Xa1qDA6zOYTIz7CO6ZTTvNaF+ATrc6M14oViUAc0XcKzxhZx0GTy+93BTRybUlHpU09yc+YbVmnCqC2ApxfAeohPpJQqqUvS/8FGJ/qrqpd+a2njTz9Nwa3sbxv8ydRx5G5O0nyQ8Ui9Z/oFwNWO4iQknHbyI35PmDdjWxYodH/A2y2jdWWs1pd+YTYVvjC2NijzpdMkw2iT+RQ+bKsoQPGaFUCdDLepSkKjJfJtGuTv0n2M0n4HCY3/kkb4dk3lN1GPo8W3d+MKXOnahS2j+JWK+4T/VDPQ9HLEoOeHwQej6H1D8ADtRNhMtMd4QpWMgGbTPJAD0blWZGtEk6PgCvN6XX0i7fyQgs3L7Bk5Kg900Wb/Oog==;20:k6onZAUtzz0M0PVtbg3MESVbHNt4R5wtEBlZ7bYI7ZM6pqw/J5AdKCg8nKJrzTbE8hDVQIkXyCpq/bSRmG2CdYfczpagWVV6CszlAKrXJkpd+l8taxRcYwIIrYxLA71lDjGvSm7QkZvccPqtT82LFQVi4fC6N0kPjnZZpl+nBdI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2016 21:51:33.3473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1197 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-13_11:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1795 Lines: 37 On 12/13/2016 09:28 AM, Jens Axboe wrote: >>> No worries, ask away if you have questions. As you might have seen, it's >>> still a little bit of a moving target, but it's getting closer every >>> day. I'll post a v3 later today hopefully that will be a good fix point >>> for you. I'll need to add the io context setup etc, that's not there >>> yet, as only cfq/bfq uses that. >>> >> >> You anticipated the question that was worrying me more, how to handle >> iocontexts :) I'll go on studying your patches while waiting for this >> (last, right?) missing piece for bfq. > > It's the last missing larger piece. We probably have a few hooks that > BFQ/CFQ currently uses that aren't wired up yet in the elevator_ops for > mq, so you'll probably have to do those as you go. I can take a look, > but I would prefer if they be done one a as-needed basis. Perhaps we can > get rid of some of them. The current 'blk-mq-sched' branch has support for getting the IO contexts setup, and assigned to requests. Only works off the task io_context for now, we ignore anything set in the bio. But that's a minor thing, generally it should work for you. Note that the mq ops have different naming than the classic elevator ops. For instance, the set_request/put_request are get_rq_priv/put_rq_priv instead. Others are different as well. In general, refer to mq-deadline.c for how the hooks work and you can compare with deadline-iosched.c, since they are still very close. Note that the io context linking uses the embedded queue lock, q->queue_lock, whereas for other things you are free to use a lock embedded in the your elevator data. Again, refer to mq-deadline, it uses dd->lock to protect the hash/rbtree. If mq-deadline used io contexts, it would manage those behind q->queue_lock. -- Jens Axboe