On 14/10/2024 10:33, Christoph Hellwig wrote: > On Thu, Oct 10, 2024 at 06:04:17PM -0700, Darrick J. Wong wrote: >> From: Darrick J. Wong <djwong@xxxxxxxxxx> >> + __u32 rg_number; /* i/o: rtgroup number */ >> + __u32 rg_length; /* o: length in blocks */ >> + __u32 rg_capacity; /* o: usable capacity in blocks */ > > So the separate length vs capacity reporting was needed for my previous > implementation of zoned devices with LBA gaps. Now that RT groups > always use segmented addressing we shouldn't need it any more. > > That being said Hans was looking into using the capacity field to > optimize data placement in power users like RockѕDB, and one thing > that might be useful for that is to exclude known fixed metadata from > the capacity field, which really is just the rtsb on rtgroup 0. > Yeah, it would be very useful for apps to know the available user capacity so that file sizes could be set up to align with that. When files are mapped to disjoint sets of realtime groups we can avoid garbage collection all together. Even if the apps can't align file sizes perfectly to the number of user writable blocks, write amplification can be minimized by aiming for it.