Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932605AbcLNPGb (ORCPT ); Wed, 14 Dec 2016 10:06:31 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:49799 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752976AbcLNPG0 (ORCPT ); Wed, 14 Dec 2016 10:06:26 -0500 Subject: Re: [PATCH 5/7] blk-mq-sched: add framework for MQ capable IO schedulers To: Bart Van Assche , , , References: <1481228005-9245-1-git-send-email-axboe@fb.com> <1481228005-9245-6-git-send-email-axboe@fb.com> <69c1261a-1a21-7347-c753-0bcb9a2ab65e@sandisk.com> CC: , From: Jens Axboe Message-ID: Date: Wed, 14 Dec 2016 08:05:12 -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: [66.29.164.166] X-ClientProxiedBy: BLUPR13CA0048.namprd13.prod.outlook.com (10.160.82.19) To CY4PR15MB1189.namprd15.prod.outlook.com (10.172.177.11) X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;2:RjCXwLJZykzT9lo9gNTBBhCaoCFM5DO43pjmrOuvZnaD/op9miexc794bKevKTMdnsIMI9N7PHas3fgO8q2HrLBv1vFLXpBunYDQmNLv5RyQOLJ+whRL52/XCPpRZ4NHPh9OEBDEI68zIzGM0fzSUTO9LmE068XMseUebitUYlM=;3:8y9Q39qCMRAG8ou0WxsXPMd6bni5i6AIVgXpcjXSBgXZs4SPpleiKpoG2nayKbgTnA7LAqJwNuwEogSgZt1773sxBRHdOKtIzZzsGBkhqSoAbB25XYpNeZON13yOUg0nMs8tx/QYbl2ziTAKk68M2uJSeXL3b8SErUu+W8LTYAg=;25:rY6UA5V/eFYq4Oqd93b3hkRU0Ya5ps22x5x4VhkbslKyyKQA8UnERz9dArHJbXBs82YOmZ2MsGl8r0sVH+7stnUQvyUoaII96VxoeW1tfRi+dlQzew/FoUbSI62TdKQZ7MVbfiQiWzsBo64Np+5TcrclGNod7PAYTr+r0/vA6a2NZ9YXdnpExLiyX5eyGC4k5jszLGvNsq8fZX2TTOHQ777G8C2aT/PLFlOsxz1SqvfkBKt0VVrh4X253w8xB41G18ROoXXe+4XGGPgAjTRZRb5Cq+T8wfAdy2oDTSkEOKUonhmlZUFnwhAn7mtf/4Ioii2ibfIw8CdJMsSjoqY/0Wl5/dVZbNX5zf/r861f6XvHi80u6DyOCNdVhqXkWg+hQ49Y1GpYjozB5KonshZsacxBv1KVsv8vl1ar+t7mH7rljRTREGYKVPG+A6xTt6jomIaf2wC4E3uj9CADN3gctA== X-MS-Office365-Filtering-Correlation-Id: 1c41e0ab-9114-41ba-75a0-08d424329f77 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR15MB1189; X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;31:p+GxoddrnI5ffaD2DHzxTVnUVbvsW1cx688MVa4/aVk3e5La03i6IdBhfpUh9Yg16FEFOyDw1LjNzRq8k5kGYb+qtZVQA6rjOkQ4hF7jGNbi0IFeRQdfaz/JEPsDhs3RcZyiUelHah+iavQiwXZMTfO2yLq8T9E5uUsdnLUZbkXc7LAPgk3IN4DnC9qPU8RYGBwLmXftxE1offHY1rX2RIxh2xNjhVtCp/MJzkKNe19b1hCqvwuuSb4UKr9jBVl+;20:Pg0J4nwwFMHVfzb97Pqc0cSwZeCdRPZwA/TvTdgHnSv0C6EojZk+zR2rgg2MePN50wllkeHHnX0zxnBWJCFYgaah3SAPURsB2YQAQwIWtyHxcfC0asx7/JfCtRXhONIjzgfzrCWlkBF4L7a+mzU7Z5/as5zgCWHrDfFoJWCOwdN8e7A89qs0wfVZKm88mgtyjsEYtrIUQYXMJuEK7zKRF5rVzrE5nTog7m7w6KLpRzP23fk8iOPIzyUbrgjK2zoSWZzQINA9FrnCfSUIafeWzi91R9VhgO1Oz4rXv9bZtaaud6dju1ED5vpMXqAjKdPzKhyt9WM2S4404DPwhhpIMUbZgMcr003Q0S3K+Ctzieg/AwmhI9wnLNiO5rmDLzUhQI9lp4/kuvfFrsUFwc5zhWovZqbsE4Q0y29uLkmDV+2iLJ9xZ9V7RTpXMaC4qEdIvlzL5W+YHtxTYL2UB9MVJX52VHfNQoD52UH/VIgJjiJusuBu/wOUeJ9EEx/iyz9F 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)(3002001)(10201501046)(6041248)(20161123564025)(20161123558021)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:CY4PR15MB1189;BCL:0;PCL:0;RULEID:;SRVR:CY4PR15MB1189; X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;4:PbPNbeby0KMngSkQ4oKHLYlUIxuiOxrJv9FLbxnQ5CxixLoC9WB4AzeTqNQtL5ssbkZT8YRwozGO5PmuI2pVyb5jie7nUVXHUlidbW9dOXyJ9dEoPQlfF+4UOVpE2YFKC+szPxfYaPLauHOsQjqDeOgE4gP1PC0ydyeJWkdh0e4n4Gsxt1097s7sBKpdQEe1LxR9tjnDGMUjnLvXfceqemoG1sgjBs5/uUKfI5RwjvcTfY+Evm4X+cfM6PXW+fHAqaHM73hsch19o1obabNAHnctVz9qp3kvW25xAUrjsrDvtf4GxupDxL9KUUFHVBII2UBLB6Kre9AewtKAfhbbvhe3uW89gVRMAGd7IhdY414J0rcZf0UOvyM45jPtr6otdxEnjY2EtsxbZPKjqiUFffLdfb2wL71DOLulOSrVJObZrlB5Isp8mtdG+AAxHFcYncISCDTd8cVubPMECjMe1PCKMQzIDl9hVZbqhKUolUmVHBJlvleUKslodWypAvotKX9Yv00wRu+h6ZtlSLY+DlNUHg3LiBvRDiNsq1Q/phAY2SEY8NXzycMkOHNcXrfBsYGfpFwlnTZnL20KlmCkQaFUBoXXS9iycvUCQuQW2GQ= X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(39410400002)(39850400002)(39840400002)(39450400003)(377454003)(199003)(189002)(24454002)(189998001)(92566002)(6116002)(97736004)(65956001)(230700001)(4326007)(83506001)(93886004)(7736002)(101416001)(42186005)(5001770100001)(2950100002)(65806001)(305945005)(81166006)(65826007)(2906002)(81156014)(1691005)(68736007)(36756003)(66066001)(23746002)(229853002)(8666005)(64126003)(5660300001)(77096006)(86362001)(6666003)(117156001)(105586002)(47776003)(8676002)(38730400001)(33646002)(6486002)(3846002)(4001350100001)(230783001)(31686004)(31696002)(50466002)(90366009)(106356001)(76176999)(54356999)(50986999)(2201001)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1189;H:[192.168.1.176];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY4PR15MB1189;23:oTXOPymT1vqdhHp47PPp3RNYtl3hedIcrDQ63?= =?Windows-1252?Q?lDB5MqGDzawY/vSTLYQc/ntYBS41pGuionUnR9EWmF8s4vbQjsbAl9Re?= =?Windows-1252?Q?IxVGpEzHrWHtT4ADSvcMIBMruuir9xorx6Sg7GWx3adL/py3LjuvcPsZ?= =?Windows-1252?Q?1r+2qv+dqLLaSweT0Zoslg3+6fLYt6R+GHVCo5dERKoDNDJNrIUZKdC8?= =?Windows-1252?Q?IOKFwfvHKiKP4s27Gy1fuycKpwkKhe9s+glcx/ErJ+Xd54v0GXF0i70o?= =?Windows-1252?Q?ZdsxVY7PbPwz+6DUoHC5eX/El62sYJ2s2UyrclXWuSRAsnKbC9TmDoD+?= =?Windows-1252?Q?h/wHnx0rJRORd7CAq4M6MrG9dxEdW1B1k2p/q4JbclKEw1BMdEc9S/B5?= =?Windows-1252?Q?JbQ1tCVzEfbwF9aHV6SsVXGVE5T1qyVoAKEC2gz3HMtRWZo0Km+uYpBV?= =?Windows-1252?Q?3AALNPQc4or086cq/QAnwSObFAlJ9cjfk/GbRle/mG6E1DnFxDCj9y+a?= =?Windows-1252?Q?uhcLZoIo1cOMzsVnVlWQsoehHCs+y+DnQ//rdp9bbI2kXzsLVGUHo/8j?= =?Windows-1252?Q?bo8CBQbvBXF4VT0+SojKBK6234xwKOGxz3Nbx6+1gnwbqALq8ge+SI0Z?= =?Windows-1252?Q?nXVSRlBNq6HT5VcF4X0S/PqSAK2tshgdwTNTb1nsH+vYfRqaPukKVohw?= =?Windows-1252?Q?8aEfgLpnhilMR8mDS9QFjtYGxBQFo+5nrVL/SJyRQ7t6XkUnBJ2tLM8S?= =?Windows-1252?Q?8T9J2RJq4qBzQMnF1+JrGwXI1eV1t0Xqbckp/CFY/qMdt/w9Fn9sqCu+?= =?Windows-1252?Q?nfNDGUO9VJcEBbJ0l3G1nUm1sSgOv1TYoS1K3y1tLY1jad2gnv6qBuUh?= =?Windows-1252?Q?k3pUDvr9pI5UDQSrp/eknNmCWVxLV2ZORJMFmduqttXlB2zcQZhbyNFU?= =?Windows-1252?Q?QBPeeKsSryzbDIt8221StOUx+YcrsIX03cr0az9Ow4oU4MHZmuRpmD0+?= =?Windows-1252?Q?XqJvrBFPut6LmS/l4Q7HTktOOM1+Pf7F188IcQL90XFKhGPhNJw1OJ53?= =?Windows-1252?Q?7OS9oa0NM27UrhJmNQRABEsy4JDN7vlrB7K9Dsr74o/2zVWV34DHa0Y+?= =?Windows-1252?Q?lSahl566QR0uIoP7EHO/hMPKLakakwTxV3ImY2+ALeif4qpTeo2aklpG?= =?Windows-1252?Q?mPwknLjydUkNrA68edaAZkxjlg76fZA5O761QL+DZVZJqjXcftZZyQCU?= =?Windows-1252?Q?TWUlop2uVL33lOtljhZFGMkId8oaM/i2q7KLJC9+Hu2NggJbIJZySYjK?= =?Windows-1252?Q?dtYwl3BZ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anlb0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1189;7:4gGeUYH6Vz1s5/LnDUXlsDje4vxqQE1Rxg3dHjlqyCMXj/dCXem+Igx4prz4D0P99qXjFTdocBNfS/zj8QIaqtftLfvs/Uq1efjWREvaMn8IboPAEoqnBfdh3miLRUvWhKe8deUzHdymc5WwM26BC3fXNez5V2MRmXTabhrCjXykxePXyYD2byVxUqoHmeDpXcHWtgwQVlyaqEYc10/qsaMZdQQSP1icIe3U4wRMZ1G7UWm3AB31yTXlUZ1DZ6NBReZXOoUhw/H8Ab80YUt/EQO/5xy7LYbaAZzmfd1WUfdXHY0fas5OC3TQjA+KiZGebWbfGkXVilIf4VPHyniHQDhjGGkOiSBZ2rJwbwHhgBU=;20:DyLOz1+gym/Ayf6jyw8K/GJepM1LWBv787O0vhU3Wmi/YNwkFiP2SvvP44KAXWFYl9aWn3zT38Td3QFheQUxids6E29cyl9pfAr6IH4ks6mV/6LG6IlQlAOCsS47JGiCB0Y3bzqUlMlltc6w90DpPIq1mGOLBlX+dD00ktx4noE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 15:05:18.9547 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1189 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-14_10:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2496 Lines: 51 On 12/14/2016 03:31 AM, Bart Van Assche wrote: > On 12/13/2016 04:14 PM, Jens Axboe wrote: >> On 12/13/2016 06:56 AM, Bart Van Assche wrote: >>> On 12/08/2016 09:13 PM, Jens Axboe wrote: >>>> +struct request *blk_mq_sched_alloc_shadow_request(struct request_queue *q, >>>> + struct blk_mq_alloc_data *data, >>>> + struct blk_mq_tags *tags, >>>> + atomic_t *wait_index) >>>> +{ >>> >>> Using the word "shadow" in the function name suggests to me that there >>> is a shadow request for every request and a request for every shadow >>> request. However, my understanding from the code is that there can be >>> requests without shadow requests (for e.g. a flush) and shadow requests >>> without requests. Shouldn't the name of this function reflect that, e.g. >>> by using "sched" or "elv" in the function name instead of "shadow"? >> >> Shadow might not be the best name. Most do have shadows though, it's >> only the rare exception like the flush, that you mention. I'll see if I >> can come up with a better name. > > Hello Jens, > > One aspect of this patch series that might turn out to be a maintenance > burden is the copying between original and shadow requests. It is easy > to overlook that rq_copy() has to be updated if a field would ever be > added to struct request. Additionally, having to allocate two requests > structures per I/O instead of one will have a runtime overhead. Do you > think the following approach would work? > - Instead of using two request structures per I/O, only use a single > request structure. > - Instead of storing one tag in the request structure, store two tags > in that structure. One tag comes from the I/O scheduler tag set > (size: nr_requests) and the other from the tag set associated with > the block driver (size: HBA queue depth). > - Only add a request to the hctx dispatch list after a block driver tag > has been assigned. This means that an I/O scheduler must keep a > request structure on a list it manages itself as long as no block > driver tag has been assigned. > - sysfs_list_show() is modified such that it shows both tags. I have considered doing exactly that, decided to go down the other path. I may still revisit, it's not that I'm a huge fan of the shadow requests and the necessary copying. We don't update the request that often, so I don't think it's going to be a big maintenance burden. But it'd be hard to claim that it's super pretty... I'll play with the idea. -- Jens Axboe