Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Namespace creation size-related fixes #938

Merged
merged 5 commits into from
Jun 16, 2021
Merged

Conversation

okartau
Copy link
Contributor

@okartau okartau commented Apr 17, 2021

We may adjust requested size upwards, so lets check for available
space after that.
This PR is meant to address points in #933

@okartau okartau changed the title WIP: Create Namespace creation size-related fixes WIP: Namespace creation size-related fixes Apr 17, 2021
@okartau okartau force-pushed the creation-size-fixes branch 4 times, most recently from ac5ac2c to 9a199e9 Compare April 22, 2021 05:41
@okartau okartau force-pushed the creation-size-fixes branch 2 times, most recently from 21de062 to 2524b1a Compare June 8, 2021 07:57
test/start-kubernetes.sh Outdated Show resolved Hide resolved
@okartau okartau force-pushed the creation-size-fixes branch from 2524b1a to cc3ed83 Compare June 8, 2021 20:58
@okartau
Copy link
Contributor Author

okartau commented Jun 10, 2021

As we discussed off-line, it could help if we used more recent libndctl, which has get_region_align function starting with v68 I believe. But our containerized build in current config will use v63

@okartau okartau force-pushed the creation-size-fixes branch from cc3ed83 to 2fe2bb2 Compare June 10, 2021 21:15
@okartau
Copy link
Contributor Author

okartau commented Jun 10, 2021

I found one way to install newer ndctl, it worked on my local setup, lets try CI now. There is also call added to get region alignment value and adjust size accordingly.

@okartau okartau force-pushed the creation-size-fixes branch 2 times, most recently from b91d4cf to b42d804 Compare June 11, 2021 19:48
pkg/ndctl/fake/region.go Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@okartau okartau force-pushed the creation-size-fixes branch from a35831a to e2998a4 Compare June 14, 2021 21:15
okartau and others added 4 commits June 15, 2021 11:20
We need newer-than-v67 of ndctl but buster has v63, so we install
ndctl from buster-backports.
Due to a redundant sort and chaining steps with ; instead of &&, the
"exit 1" after a failure did not affect the overall result of the
command.
This is the outcome of the discussion in
intel#933 (comment)
@okartau okartau force-pushed the creation-size-fixes branch from e2998a4 to fa16e62 Compare June 15, 2021 08:21
pkg/ndctl/region.go Outdated Show resolved Hide resolved
pkg/ndctl/region.go Outdated Show resolved Hide resolved
pkg/pmem-device-manager/pmd-lvm.go Outdated Show resolved Hide resolved
pkg/pmem-device-manager/pmd-ndctl.go Outdated Show resolved Hide resolved
pkg/pmem-device-manager/pmd-ndctl.go Outdated Show resolved Hide resolved
pkg/ndctl/region.go Outdated Show resolved Hide resolved
@okartau okartau force-pushed the creation-size-fixes branch from fa16e62 to bc503b2 Compare June 15, 2021 20:17
pkg/ndctl/region.go Outdated Show resolved Hide resolved
pkg/ndctl/region.go Outdated Show resolved Hide resolved
pkg/ndctl/region.go Outdated Show resolved Hide resolved
Added interface to get Region Alignment value.
Alignment adjust happens in region.go, not in device mgr layer.
Use 2M alignment instead of 1G.
LVM-mode manager creation simplified: does create only one
namespace per region. This eliminates problem of small leftover
which will be found on next start and one more namespace created.
Do not pass Align from device manager layer to region.go.
region.go: added LCM and GCD functions.
region.go CreateNamespace: Calculate LCM of two aligns.
Align creation size up to closest LCM alignment boundary.
Moved size check to happen after change by alignment.
@okartau okartau force-pushed the creation-size-fixes branch from bc503b2 to 7ae5a42 Compare June 16, 2021 10:29
@okartau
Copy link
Contributor Author

okartau commented Jun 16, 2021

pushed version addressing recent comments. I had to change code on fake/ side to adapt to change of Opts, now the CreateNamespace is slightly different there, do you think we need to unify that to real one in this PR? This would need more work, for example new LCM() should be made common then, I did not start that part now.

@pohly
Copy link
Contributor

pohly commented Jun 16, 2021

now the CreateNamespace is slightly different there, do you think we need to unify that to real one in this PR? This would need more work, for example new LCM() should be made common then, I did not start that part now.

This can be done later. I had noticed that the new math functions do not really belong into the file where they were added, but decided to ignore that.

@okartau
Copy link
Contributor Author

okartau commented Jun 16, 2021

Not quite solved the way I meant (opts.Size still gets modified eventually)

My thinking was: opts.Size gets checked and used later in function, so I put modified value back and avoid using those other places, keeping current change impact smaller. Other fields of Opts are modified in that function as well, making Size local variable would raise question why Size deserves local variable on changing but not others

@okartau okartau changed the title WIP: Namespace creation size-related fixes Namespace creation size-related fixes Jun 16, 2021
@pohly pohly merged commit 58653fc into intel:devel Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants