From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 4/6] block: Add 'zoned' sysfs queue attribute To: Hannes Reinecke , Bart Van Assche , "Martin K. Petersen" References: <1468934439-93579-1-git-send-email-hare@suse.de> <1468934439-93579-5-git-send-email-hare@suse.de> <1dc7f9d7-5a91-b160-7031-8d69ede5567b@sandisk.com> <13b63331-f920-0904-b8f7-c3a2ea8270d6@suse.de> <836c9ee7-3d1e-7336-342c-ce0efee12422@sandisk.com> <65e6de30-4811-969b-6c9e-312104e1ae6a@sandisk.com> Cc: Jens Axboe , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , Damien Le Moal From: Jens Axboe Message-ID: <27602646-c6bb-4acb-2013-aef7805152a7@kernel.dk> Date: Mon, 25 Jul 2016 08:45:31 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed List-ID: On 07/24/2016 11:56 PM, Hannes Reinecke wrote: > On 07/24/2016 03:51 PM, Bart Van Assche wrote: >> On 07/24/16 06:37, Bart Van Assche wrote: >>> On 07/24/16 00:10, Hannes Reinecke wrote: >>>> On 07/24/2016 12:13 AM, Bart Van Assche wrote: >>>>> On 07/23/16 05:43, Hannes Reinecke wrote: >>>>>> On 07/22/2016 10:45 PM, Martin K. Petersen wrote: >>>>>>>>>>>> "Hannes" == Hannes Reinecke writes: >>>>>>> >>>>>>> Hannes> Add a sysfs queue attribute 'zoned' to display the zone >>>>>>> layout >>>>>>> Hannes> for zoned devices. >>>>>>> >>>>>>> Not quite one value per file :( >>>>>>> >>>>>> Yes. >>>>>> But I wanted to display the zone layout in a concise way allowing >>>>>> user-space programs to determine the zone layout without having to >>>>>> issue a 'REPORT ZONES' command themselves. >>>>>> I found it slightly pointless to add one sysfs entry per zone, >>>>>> and at the same time a simple 'zone_size' attribute wouldn't cover all >>>>>> possibilities. >>>>>> >>>>>> However, as SMR drives seem to stabilise around having a fixed zone >>>>>> size >>>>>> (with a possible exemption of the last zone to cover left-overs) >>>>>> I'd be fine a replace this with a single 'zone_size' attribute which >>>>>> could be set to eg '-1' for drives which indeed would implement >>>>>> variable >>>>>> zone sizes. >>>>> >>>>> It's not that hard to convert the information exported by >>>>> queue_zoned_show() from a single sysfs attribute into one directory per >>>>> zone. Doing so would make it much easier for scripts to parse that >>>>> information and would also avoid that the zone information has to be >>>>> truncated because not all of it fits into a single page. >>>>> >>>> But this is precisely what I've tried to avoid. >>>> Creating one file or directory per zone would mean we'll end up with >>>> rough 20k files/directories. >>>> Which I found rather excessive. >>>> >>>> Of course, it that is not a concern that I can easily convert it. >>> >>> If there are 10K zones and since queue_zoned_show() is limited to one >>> page then only a very small fraction of the zone information will be >>> available through sysfs. I remember from your presentations that reading >>> the zone information is slow. Is 10K zones a typical value or a worst >>> case value? >> >> (replying to my own e-mail) >> >> Something I should have asked before: is the zone information intended >> for end users or rather for software developers? In the latter case, >> have you considered to use debugfs instead of sysfs to export this >> information? From Documentation/filesystems/debugfs.txt: "Unlike /proc, >> which is only meant for information about a process, or sysfs, which has >> strict one-value-per-file rules, debugfs has no rules at all." >> > I would be perfectly fine with exporting the zone information via debugfs. > But at the same time I would like to have a simple sysfs representation > for SMR drives which can be utilized by mkfs and friend. Then provide a real interface, through a library. Don't expose tons of zones through sysfs, and expect applications to parse that. That's silly. -- Jens Axboe