From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756287AbcHZCd3 (ORCPT ); Thu, 25 Aug 2016 22:33:29 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:3013 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbcHZCdY (ORCPT ); Thu, 25 Aug 2016 22:33:24 -0400 X-IronPort-AV: E=Sophos;i="5.28,579,1464624000"; d="scan'208";a="15536958" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Subject: Re: [PATCH v8 1/2 RESEND] Add bio/request flags to issue ZBC/ZAC commands To: Shaun Tancheff , , , References: <20160822042010.32416-2-shaun@tancheff.com> <20160824202409.30345-1-shaun@tancheff.com> CC: Jens Axboe , Christoph Hellwig , "James E . J . Bottomley" , "Martin K . Petersen" , Hannes Reinecke , Josh Bingaman , "David S . Miller" , Geert Uytterhoeven , Andrew Morton , Greg Kroah-Hartman , Mauro Carvalho Chehab , Guenter Roeck , Ming Lei , Mike Christie , Keith Busch , Mike Snitzer , Johannes Thumshirn , Shaohua Li , Dan Williams , Sagi Grimberg , stephen hemminger , Jarkko Sakkinen , Alexandre Bounine , Asias He , Sabrina Dubroca , Mike Frysinger , Andrea Arcangeli , Linus Walleij , Jeff Layton , "J . Bruce Fields" , , , , Jaegeuk Kim , Shaun Tancheff From: Damien Le Moal Message-ID: <5b710eda-6445-f42a-72f0-4a1bf843d501@hgst.com> Date: Fri, 26 Aug 2016 11:31:46 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160824202409.30345-1-shaun@tancheff.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [111.99.34.114] X-ClientProxiedBy: TY1PR01CA0063.jpnprd01.prod.outlook.com (10.167.153.151) To BL2PR04MB1969.namprd04.prod.outlook.com (10.167.97.141) X-MS-Office365-Filtering-Correlation-Id: d054f959-8297-4857-e593-08d3cd592ff7 X-Microsoft-Exchange-Diagnostics: 1;BL2PR04MB1969;2:eTHuBHEMDVkdQ3ohdbijP55XC1mcbMIdWxVzSo/X0z50aNk/x343N5SPZZEh0u50aKiS3USBqd8yCBZojX0FZP7oFP3fSRVoFEl9c1vnOqpD5Hz7tHudplBCqY6BBI/s0LhsmF9wLkLp4EhHm2TvEY5ey8V0kaDHjEHN/J4VLTFXH8DM9XRwH2mxsgQZgGG7;3:lxg2gZmHJsdCNwPb9YdDCjpENuBzDYvTvZeJUAi707ZjFUVhY9BBuJngleVv2kMkszeA2trFS3vACz33VIkmx5KMByvfrRruHkXm/eos15JmWlVrG7+s8PTqqkmm6IPj;25:SdyO2+9Bkbg50/9Pj52lXwRzpa8lgaVPC2V+GyMgBma7vjFASnnINEKue362D8bJiHUpFUPy/nCMKAmMdJb+tpqXFIGmU0qYqulZvjd+mzo666Rhinyze9rmzTD8skiG2YyYBoXKMA9qLCEWr/ew7Q3jRK44OywJe/DD00ecgonYhG6d4M0SB29UFW+UjbjCB85O3M1WMeSuaTK5PRwuO4tSH5RF/kwgImnsgjkcZKiD53d2j9/AQ1+uqTF6ChKOH1rFcW5GN/qjTI7YJNj1fu4YDREOczsvYWQykLoH3GfFvbJ4U68+1vQyjpwt5HpiXZtJ7eBhSfSOnBHigeIDjohHNNzWKq2NFClMFc/RaM3zC3hVR/nkTfO3msIjzeKbKWnOrQ1aeDbXocbYedUEIPY+e3C3sDsSFkK8hseKenE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR04MB1969; X-Microsoft-Exchange-Diagnostics: 1;BL2PR04MB1969;31:DP2tE+D6jBGhjPQzT/tB3Aaw4o0KzYULG/p3OvFU91qL+xZsMWNC5Oq1VdxLvMxM5CsDNjQSK1VSG7j7WBGxxfky4BvYa4OOeAAd22ET8lf+s0am1RGEiKSQ5kaBQegy/KGYZRQiVwwXI5cC3j+Tgv+joCtKUvCrp4elhxePeqPYigwQk/nFHg3bX0dlUKSjow96f1kse5eT6hYcLxJ8mxj2VhXnHDzrKxanh7LA774=;20:ytMsMDIaOliu2HC67IHzsZoIRbvpIU4zT+zBfuHP8+5dyafN2WIC11cksO71qbyvqz+tA5bcKm8mG+4HFfvVljP1shZ8I3Te0+scKoy8G+9BDiLeHHCdtWmI/PKexzxyMA6C+kdVkouCNwP8/S2dqPv0jw+G0IT/C8FdACpzTMq3seoVcJyI75k3J6sEfgcNF7JDu32Dwt9xabSpTgNX2VPPQCpSOsY8Kh4M50QpZaT3JDiU+KJF6Rk6ug5F9NKJp+LwNJU6Nr4lLJomukgn4tvkoisa6CL4SdinT2TvSnVMlYamqWFLl8gxafdFWxfLBu7LUcW9O6oGbjXGJUsI2jcL+lDpQ4vxuy/l5Nhog3IugACymAlCZrq0jZ65UK7eONoO0cvU1LxGW1Xi4mQtE+HGEyLcWZkvjaVwfIZ+m/43c97vZDUp4V4WLc1nqJMNmBgN3tnksPuK/jJa+r6XIPNOT6VBbguhs7SanL/802hxH/bP+PozyJFeTey3aY/y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625)(56741022784758)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:BL2PR04MB1969;BCL:0;PCL:0;RULEID:;SRVR:BL2PR04MB1969; X-Microsoft-Exchange-Diagnostics: 1;BL2PR04MB1969;4:6Da7wJF3Ie8qxSHvbgiUlTGL4LO4coisRewsO8gQmkE6OlrXVuMZAN8PuIaBBcUS6GcKL0SBOSexJqKtNtYOyudsQdfNmXun2jKYb7CMN54cM5vMej3BGDjMcqeO9CZl47g1PFiC1UItu4nrur7KGpfaiHu79ys01XAE7E6hxOEMTbSKg5g+iQ1N4y67qfSFEabXzhjh0cHXe4K7+I5NdvXqp7IY14Lj7eJRcBOtSJynt8UU5wILH2oaHe187YTJtNeIxejvmNHkaJZgXtR0GlWsLOI1b995y0pj7mOM2VCzrhWXyj7xZIFboC2j1vSu1J1OM7ukcnw0IdtJeiZfj/k8R8eVCbdmbveNEssOew9rEDqrXrBUvfN2wf34duxiFx+deVbCFBZF6pRHyVz6/5q/6FON2XR7dNnXjCuw15nhQ6oAndtU+g+bKoAWQgrafn6svmbmhZhJkd9g7GGAX+uupWTm5rD/xGoJH1qQzlqLHf2OQMbhX2h0AdNThtxHlrOSVEq11Ykgzu8ghhbYlA== X-Forefront-PRVS: 00462943DE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(76104003)(24454002)(189002)(199003)(377424004)(50986999)(6116002)(54356999)(3846002)(83506001)(33646002)(92566002)(101416001)(19580405001)(586003)(4326007)(19580395003)(2906002)(77096005)(106356001)(105586002)(2950100001)(36756003)(5001770100001)(4001350100001)(86362001)(189998001)(23746002)(31696002)(97736004)(47776003)(2201001)(117156001)(66066001)(65956001)(7736002)(7406005)(15974865002)(65806001)(42186005)(5660300001)(7846002)(76176999)(7416002)(305945005)(230700001)(50466002)(68736007)(8676002)(81166006)(31686004)(81156014)(64126003)(65826006)(18886075002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR04MB1969;H:[192.168.1.9];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BL2PR04MB1969;23:lT7frmuYMnzaSsX9kkPp/ANdklnZ/7xzsk+7j?= =?Windows-1252?Q?jC3uXvV7J4DTFekbeUH4uMuMyDFSyCDwjSBHqHNSr9JfN2CH6K5aEF0y?= =?Windows-1252?Q?iGbE2+kRjTuvle/W7W53VOlUWJA6yE2p3HflvRys/UDmIOae4xAuEDYw?= =?Windows-1252?Q?JF49J9WadYXt0Xl9MXrln3yH2QpOCimS4fa3zLlC0HasrUiH3ESo2/OJ?= =?Windows-1252?Q?/V/TP7MtzZ3fv0QlPcvniVlDa7XvAIoFRD9SEyCvUc4wcePIeq4yaIub?= =?Windows-1252?Q?1HpQ4a9KVlWTKsOiBxe0mv+sZepKEda1McoicdMlqiYTobJqoJtPDirM?= =?Windows-1252?Q?n4YYVKaBi8XxmSO9K7zo8I14aoT6F7ObF2SrcCWcRIrU/uj/F5P8JiDz?= =?Windows-1252?Q?jVh7YYpFj+dlqQ5htSqyYW0VuY41ueh6AycNXFfNpheNeLEaPyZwdNCw?= =?Windows-1252?Q?+6eojDd2ZFrsmKOfeVV2AoR8fqqGjXXUOSO8pQoiJoYaCMpOYBJ56O3K?= =?Windows-1252?Q?urSSYTY0VNr0np633ZJgBGs9S7jUBOL7syMhXZZkBF0mkh7qq3sdQYaH?= =?Windows-1252?Q?eMP6PACN8SM7HddyLlekijejCkoYilT8hmOSoq6Zp9tzV0Vx7d1ZqAC/?= =?Windows-1252?Q?2dZ1TnPuZNh+owozrBWQUy0BafCiM4reU66ViB+UDslWt7mC7xe2oP5v?= =?Windows-1252?Q?1LmkxcwkiFYDAAYC29LoLTYBm+9DSCSpsYeYXrf8jz/fexHm/LIakqdA?= =?Windows-1252?Q?IMqkSBZ2dhbuuJqQAr8KjUYpw4Q5z/WS7ki4j5afc0Yu4YUV2fPZ87IF?= =?Windows-1252?Q?KQGiCzFEzopvkv8FEOC6ZX2OWi4Xv8UGmoALoYg3jo/CG8fBY7soTxvT?= =?Windows-1252?Q?Pyj0jHNzdXvPUDPyEEsPoTgHltkmYSquS22lLoyZZrv26c3BhhiTqGBQ?= =?Windows-1252?Q?CbJykJ7z6ipsFf/E7vmtyn1avRF8uoY5QqXP+iUGIy7mvWUJOSUtgoaW?= =?Windows-1252?Q?cWpypfs/2uh6JS0BdFFxegyH8/RqPgYRKYkGIxGdDm6zkgfjGXnaQWEH?= =?Windows-1252?Q?IvnT4xh93zbIKo3d/GyX2PFFTCdA0KiofZoygLJgAPW/g0RB3Mqvwusk?= =?Windows-1252?Q?e5LOeIZa50TPksBeGKU2K1xqZF1N+EIphIOcZ+X670tML6w0f7vubiVI?= =?Windows-1252?Q?CSe2p5V2BWpfX8M2pY8qWuu5+N4Nw5Xcpaxpc3P8z6Tx1SqX58OpCBAr?= =?Windows-1252?Q?gINdv/y4hqPm+C/ixCc90tCWsuZhRrs703Q6HP9wl4wkQA3kDAXgV3kY?= =?Windows-1252?Q?1vDbAWe3p9zNft79fusxTbLh3836UaLxx+rUNlUb+fDA55Bm6hI88GXX?= =?Windows-1252?Q?aOJ1XANwtdDdF7x1EC9APacqEoKfwHl2FV+S8NeGxaMMp/00iQGZMVKO?= =?Windows-1252?Q?ljGqh+WH80AIOFydYqEdOysjoEcl1X+IRDwVIytrgZ/s+sMRDLOiX5L4?= =?Windows-1252?Q?WeaCAJGR2gx62hlkM084wLmWYiktvNPEXTeQDaZgmstF0PUiw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BL2PR04MB1969;6:0VW+L09w+8HS1W0uBGCjKCOm+JWmHe5EmRiUxJ1+ajQ9wj3CWh1FEtWWZ+dcUjW+OGPYZsOJm7SiB2LUHaeC8jm3n/GpSJgUw8nwyc9+eCqXQz68sGkpn0y+sA2G5TPeIb9u3a8DEOGTTSqjy4o37XfE1LdFAy7qVM0lCHINm3gI1hUkW6rOLj+x4u84D71p5ttWJkVfccJnfQYa6xlgA9STRL+J3n13/OPByO/ssOSOlxMFwS0HvW2lPf7zOfpn4Iu+q83c/84okePdqKOsb1IKQWvvRK5Ri1g7jbrRQKTkKMsIPx2Ow83Ot5jN8SXa7c6Gn1qt929btz23eTInFA==;5:D5nnDZeMcdWxqVG6HFe4XT5OTEFlkoYPKM2dFcPJP7VmyohqBBs3slXIky0AKfhwqq8wKl6QUVMr3U9tGz263JbuyL2836EMS4W7LS6im/QaEHi7oq3yE18Sb2hCGjoHWJ/CtWSJCk/xRgCoSId+/g==;24:udoEulNOi7CHlZJzTUo2XRSE2Mnkj/bIGBoeRk30teEh1MttzS+NbiXqhnNgP3VHQKkhbzfZSl7QGxr//UAm1OG0O1Ptm3SoWxLOOKHUQhY=;7:dqQ4Q/MY6TxjGh4w+HIFOXPr2svYk/NtfbNvFytEO1AQvQfwatduAcxe3iJ5x1LshfyBXEYVDEH8CYUJt9Rn/trqz2H8eA9bM7A6BA8bQx7ntZ30khYvoGxJPgpFq4947jAqhfv0uxQzbG025i30kiTArKhF/xMW50gV+GtM4nw9iyf7D3lCcLWt8ZtLChV3LxOP9Zu6tN21vldx/NjU//SrQSv9CI4vIAl7PezyZdaJmjV2LwUsk1jTxRqZE4RK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR04MB1969;20:DcnAIuLBUpxPKzrPvfS/q/dVO6u1Oos5XhUoLols0tb0qObOELJbolMoO38Hr12pKNFi9kL+DGiB+3m5NHyMzZypKNo0uKT8Mxl+WK05ULvjnfOz5zKX20EJGzV2nF35L9CR21qUeDrNBQhubY1QriCP157ZugvN5U3q4x/ogqkCU/OD36dNhdW35Q1iZXi4H1yeks6jy4WrHHx0Clv/j/vFfy6c2aJoX/g1N/wbKgfgdmVtgty/DlHxMraBujoV X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 02:32:06.1845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB1969 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shaun, On 8/25/16 05:24, Shaun Tancheff wrote: > (RESENDING to include f2fs, fs-devel and dm-devel) > > Add op flags to access to zone information as well as open, close > and reset zones: > - REQ_OP_ZONE_REPORT - Query zone information (Report zones) > - REQ_OP_ZONE_OPEN - Explicitly open a zone for writing > - REQ_OP_ZONE_CLOSE - Explicitly close a zone > - REQ_OP_ZONE_FINISH - Explicitly finish a zone > - REQ_OP_ZONE_RESET - Reset Write Pointer to start of zone > > These op flags can be used to create bio's to control zoned devices > through the block layer. I still have a hard time seeing the need for the REQ_OP_ZONE_REPORT operation assuming that the device queue will hold a zone information cache, Hannes RB-tree or your array type, whichever. Let's try to think simply here: if the disk user (and FS, a device mapper or an application doing raw disk accesses) wants to access the disk zone information, why would it need to issue a BIO when calling blkdev_lookup_zone would exactly give that information straight out of memory (so much faster) ? I thought hard about this, but cannot think of any value for the BIO-to-disk option. It seems to me to be equivalent to systematically doing a page cache read even if the page cache tells us that the page is up-to-date... Moreover, issuing a report zone to the disk may return information that is in fact incorrect, as that would not take into account the eventual set of write requests that was dispatched but not yet processed by the disk (some zone write pointer may be reported with a value lower than what the zone cache maintains). Dealing (and fixing) these inconsistencies would force an update of the report zone result using the information of the zone cache, which in itself sounds like a good justification of not doing a report zones in the first place. I am fine with the other operations, and in fact having a BIO interface for them to send down to the SCSI layer is better than any other method. It will causes them to be seen in sd_init_command, which is the path taken for read and write commands too. So all zone cache information checking and updating can be done in that single place and serialized with a spinlock. Maintenance of the zone cache information becomes very easy. Any divergence of the zone cache information with the actual state of the disk will likely cause an error (unaligned write or other). Having a specific report zone BIO option will not help the disk user recover from those. Hannes current implementation make sure that the information of the zone for the failed request is automatically updated. That is enough to maintain the zone cache information uptodate, and a zone information can be marked as "in update" for the user to notice and wait for the refreshed information. The ioctl code for reporting zones does not need the specific request op code either. Again, blkdev_lookup_zone can provide zone information, and an emulation of the reporting options filtering is also trivial to implement on top of that, if really required (I do not think that is strongly needed though). Without the report zone operation, your patch set size would significantly shrink and merging with Hannes work becomes very easy too. Please let me know what you think. If we drop this, we can get a clean and full ZBC support patch set ready in no time at all. Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Group, HGST Research, HGST, a Western Digital brand Damien.LeMoal@hgst.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.hgst.com