-
Notifications
You must be signed in to change notification settings - Fork 21
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
neonvm: introduce CPU sysfs state scaling flow based on the vmSpec.cpuScalingMode #1111
base: main
Are you sure you want to change the base?
Conversation
85608dd
to
dfe79f1
Compare
94bdcba
to
002f978
Compare
508920e
to
e48f902
Compare
e48f902
to
6156c36
Compare
FYI, @sharnoff |
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.
Partial review, haven't yet gotten to the neonvm-controller changes
935c4fa
to
5a094ae
Compare
5a094ae
to
82a4827
Compare
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.
A lot of suggestions around naming, and other.
f1af40d
to
0658f05
Compare
952fa49
to
af1e76d
Compare
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.
One more round. I think after this it's likely to be good to go.
ffd9538
to
27299cb
Compare
…xplicitly default the field value if it is not set Signed-off-by: Misha Sakhnov <[email protected]>
…nd mark vmSpec.Guest.CPUs.Min as online during the boot Signed-off-by: Misha Sakhnov <[email protected]>
Signed-off-by: Misha Sakhnov <[email protected]>
introduce separate CPU scaling flow based on the vmSpec.cpuScalingMode If vmSpec.cpuScalingMode is equal to `qmp_scaling` the logic of the scaling is preserved as before: - Scale, if required the amount of CPUs using qmp commands. - If it is required to scale cgroups, call vm-runner /cpu_change endpoint if vmSpec.cpuScalingMode is equal to `cpuSysfsStateScaling` all cpu scaling requests go directly to the vm-runner /cpu_change, which in that configuration goes to the neonvm-daemon to reconcile required amount of online CPUs. Value `cpuSysfsStateScaling` also modifies the qemu and the kernel arguments to enable plug all CPUs but mark as online only first one. Signed-off-by: Misha Sakhnov <[email protected]>
pass cpuScalingMode as argument to the vm-runner rename arguments, constants and functions here and there drop unused code move default cpu scaling mode to controller argument Signed-off-by: Misha Sakhnov <[email protected]>
Co-authored-by: Oleg Vasilev <[email protected]>
Signed-off-by: Misha Sakhnov <[email protected]>
Signed-off-by: Misha Sakhnov <[email protected]>
Co-authored-by: Oleg Vasilev <[email protected]>
Signed-off-by: Misha Sakhnov <[email protected]>
change CpuScalingMode to be a enum type drop obsolete comments Signed-off-by: Misha Sakhnov <[email protected]>
Improve readability in pkg/neonvm/controllers/vm_controller_cpu_scaling.go by adding empty lines and comments Signed-off-by: Misha Sakhnov <[email protected]>
Change scaling logic to work with ranges instead of slices Split sys fs scaling struture to allow unit testing Add unit tests for the main reconcilation logic Signed-off-by: Misha Sakhnov <[email protected]>
Get current state through aggregated /cpu/online file instead of using per-cpu files Signed-off-by: Misha Sakhnov <[email protected]>
Co-authored-by: Em Sharnoff <[email protected]> Signed-off-by: Misha Sakhnov <[email protected]>
c903044
to
f7a2585
Compare
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.
Looks great! 🚀
Left just a couple final comments
f7a2585
to
d0af69f
Compare
Change cpuscaling logic to work with collection of IDs Signed-off-by: Misha Sakhnov <[email protected]>
d0af69f
to
fe10eef
Compare
Introduce separate CPU scaling flow based on the vmSpec.cpuScalingMode
If vmSpec.cpuScalingMode is equal to
qmpScaling
the logic of thescaling is preserved as before:
if vmSpec.cpuScalingMode is equal to
sysfsScaling
all cpuscaling requests go directly to the vm-runner /cpu_change, which in
that configuration goes to the neonvm-daemon to reconcile required
amount of online CPUs.
Value
cpuSysfsStateScaling
also modifies the qemu and the kernelarguments to enable plug all CPUs but mark as online only first one.