-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add spa_get_worst_case_min_alloc() function #17758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Providing a public interface makes sense. We currently have internal zio_roundup_alloc_size()
etc, but it is a bit different. I wonder if we could use it to report some warnings for internal consumers, like setting recordsize/volblocksize too small.
About the implementation though, I wonder if it could be a part of vdev_spa_set_alloc()
, similar to spa_min_alloc
.
285fc98
to
aaf3cff
Compare
Good idea. I've reworked the change to add a I also went ahead and wired up the existing I've marked this as a draft for comment since I've only thus far compiled it locally. |
Provide an interface to retrieve the lowest and highest minimum allocation size for the normal allocation class. This can be used by external consumers of the DMU to estimate potential wasted capacity when setting the recordsize for an object. The new "min_alloc" and "max_alloc" keys are added to the pool configuration and used by default_volblocksize() to warn when an ineffecient block size is requested. For older kmods which don't yet include the new keys fallback to the previous logic. Signed-off-by: Brian D Behlendorf <[email protected]>
aaf3cff
to
6bef327
Compare
Provide an interface to retrieve the lowest and highest minimum allocation size for the normal allocation class. This can be used by external consumers of the DMU to estimate potential wasted capacity when setting the recordsize for an object. The new "min_alloc" and "max_alloc" keys are added to the pool configuration and used by default_volblocksize() to warn when an ineffecient block size is requested. For older kmods which don't yet include the new keys fallback to the previous logic. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#17758
Motivation and Context
Currently there's no mechanism for an external DMU consumer to determine the worst case minimum allocation. This can result in significant wasted capacity if a small (4k) record size is specified for certain pools layouts such as dRAID.
Description
Provide an interface to fetch the worst case minimum allocation size for a pool. This is mainly needed for dRAID pools which always pad to a full stripe width.
How Has This Been Tested?
Locally compiled.
Types of changes