-
Notifications
You must be signed in to change notification settings - Fork 139
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
[RFC] create-namespace: Add percentage option #209
base: main
Are you sure you want to change the base?
Conversation
The size option of the create-namespace command can now take a percentage of the total region size as the desired size. E.g. : ndctl create-namespace -s 50% will create a namespace using half of the total region size, assuming there is enough available capacity in the region for the request. Only whole percentages are correctly parsed at the moment e.g. 12%, but not 12.5%. Sizes that result in a misaligned size with regards to region alignment (default 16MB) are rounded down, unless the rounded-up size would result in using the full remaining region capacity available. Fixes: pmem#199 Signed-off-by: Vasilis Liaskovitis <[email protected]>
Example allocating 50%, 25%, 13%, 12% of a region. The 13% and 12% percentages result in sizes that are rounded-down and up respectively. In the end the whole capacity is used as expected.
|
Generally though, the constant rounding-down and final rounding-up leaves unused space in the region, obviously. E.g. trying to allocate namespaces with following percentages: 40%, 30%, 15%, 10%, 5% does leave 32 MB unused in the region in the end, although in theory the user would expect all capacity (100%) to be used.
|
I am not sure this option would make sense, so I 've opened an RFC/wip for discussion.
The size option of the create-namespace command can now take a percentage of
the total region size as the desired size. E.g. :
ndctl create-namespace -s 50%
will create a namespace using half of the total region size, assuming
there is enough available capacity in the region for the request.
Only whole percentages are correctly parsed at the moment e.g. 12%, but
not 12.5%.
Sizes that result in a misaligned size with regards to region alignment
(default 16MB) are rounded down, unless the rounded-up size would result
in using the full remaining region capacity available.
Fixes: #199
Signed-off-by: Vasilis Liaskovitis [email protected]