Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make sure that VM::get_speed() returns the correct value after a migration
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 11 Aug 2020 23:37:39 +0000 (01:37 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 12 Aug 2020 08:51:54 +0000 (10:51 +0200)
commit46b3f69b83f27f9958a26e19b21ce4be64914d71
tree23f2de3090ec9acb1b80865948eff396bea37008
parent91954c5dec0ca32d2b45587f0b6e805d3d6e55d9
Make sure that VM::get_speed() returns the correct value after a migration

For that, I reset the physical fields of the CPU (speed_, pstate_ and
speed_per_pstate_) to the ones of the new physical host during the
migration.

Maybe we should change only the speed_, and prevent the use of pstate
things in VM?

Another approach for this commit could be to make Host::get_speed()
and friend virtual, and to override them in the VM to use the values
of the underlying physical CPU (ie, of get_pm()->pimple_cpu) instead
of the one of the VM's VCPU, but I fear to still use the wrong speed
in some cases, in particular when a new execution in created onto the
VCPU.

This forbids speed_per_pstate_ to be 'const', since we reset it for
VCPUs on VM migration. Another approach could have been to destroy and
re-create the VCPU on migration, but I'd have to update the LMM to
point the Execs to the newly created resource, which seems
troublesome.
src/plugins/vm/VirtualMachineImpl.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp