Bug 1222516 - MOM's CPU QoS needs to be aware of migration autoconvergence
Summary: MOM's CPU QoS needs to be aware of migration autoconvergence
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: mom
Classification: oVirt
Component: General
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.0-alpha
: ---
Assignee: Martin Sivák
QA Contact: Shira Maximov
URL:
Whiteboard:
Depends On: migration_improvements
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-18 12:17 UTC by Michal Skrivanek
Modified: 2016-11-22 13:32 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-11-22 13:32:07 UTC
oVirt Team: SLA
Embargoed:
dfediuck: ovirt-4.1?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Michal Skrivanek 2015-05-18 12:17:13 UTC
EL7 QEMU feature of migration autoconvergence uses cgroups to slow down the source guest when it is dirtying memory pages too fast. This conflicts with the (not only) default CPU QoS set by oVirt and these two features fight against each other.

One proposal was to make MOM aware that migration is going on and do not enforce CPU QoS during that time, allowing autoconvergence to kick in. This should be race-free when not going through engine, e.g. MOM will be aware of the VDSM's Migration Source state and skip the policy checks for the timebeing.

Comment 1 Doron Fediuck 2015-05-18 12:29:56 UTC
(In reply to Michal Skrivanek from comment #0)
> EL7 QEMU feature of migration autoconvergence uses cgroups to slow down the
> source guest when it is dirtying memory pages too fast. This conflicts with
> the (not only) default CPU QoS set by oVirt and these two features fight
> against each other.
> 
> One proposal was to make MOM aware that migration is going on and do not
> enforce CPU QoS during that time, allowing autoconvergence to kick in. This
> should be race-free when not going through engine, e.g. MOM will be aware of
> the VDSM's Migration Source state and skip the policy checks for the
> timebeing.

Michal,
autoconvergence is changing cgroups to throttle CPU consumption (several times).
We should expect it to be less than the QoS limitation, so it should not be an issue. Even if MoM updates the cgroups during migration, autoconvergence is
repeatedly updating the cgroups which means it should be fine.

Do you have any samples to show where MoM settings are actually interrupting migration?

Comment 2 Michal Skrivanek 2015-05-18 12:33:51 UTC
Yes, preliminary tests by srao indicated it's getting in teh way. Martin confirmed the code is resetting the values every 10s to the configured value (i.e. increasing it back when qemu slows down the guest) rendering the feature nonfunctional, the VM still can't converge.
This corresponds with the observation.

It may get tricky when some limit is applied by oVirt - need to verify QEMU side if they take into account anyone else setting an arbitrary limit in advance.

Comment 3 Martin Sivák 2015-05-18 12:50:24 UTC
There is one thing you all are confused about. MOM does not set cgroups. MOM sets the cpu limit by calling libvirt and passing the settings (measurement period, maximum used time) there.

Only libvirt knows about how that is converted to cgroups.

Comment 4 Doron Fediuck 2015-05-18 15:26:25 UTC
(In reply to Martin Sivák from comment #3)
> There is one thing you all are confused about. MOM does not set cgroups. MOM
> sets the cpu limit by calling libvirt and passing the settings (measurement
> period, maximum used time) there.
> 
> Only libvirt knows about how that is converted to cgroups.

Martin, 
can we stop calling libvirt to set CPU tuning for migrating VMs?
This should resolve the issue.

Comment 5 Martin Sivák 2015-05-18 16:12:35 UTC
> Martin, 
> can we stop calling libvirt to set CPU tuning for migrating VMs?

Yes we can stop issuing the CPU QoS updates when the VM is migrating (if we have a way of detecting that from MOM).

But that is just a workaround for a bigger and hidden issue. We are not supposed to know that the limitation is implemented using cgroups… and so we should ask libvirt for a solution from their side as well.


Workarounding this on our side will cause situations where the user updates the CPU limit to be more strict (60% -> 40% for example) and we won't reflect it during migration (which can take while). It will also let the VM do whatever it wishes if no auto-converge is happening (I suppose qemu will release the limitation if it is not needed).

Comment 6 Shira Maximov 2015-08-16 08:39:13 UTC
Martin, can you please provide steps to verify the bug?

thanks

Comment 7 Martin Sivák 2015-08-24 12:38:46 UTC
Shira: Well I am not the reporter so actually no I do not have the reproducer..

Michal: Qemu is not using cgroups according to the developers, neither is libvirt apart from what we tell it to do. So who is changing the values? Might it be kernel via some indirect way when Qemu requests the throttling?

Comment 8 Michal Skrivanek 2015-09-01 10:39:05 UTC
since the QoS limiting was only a proof of concept and AFAIK it is not actively used/deployed we can keep this for later release.
Pending discussion about what layer should actually control QoS during migration

Comment 9 Doron Fediuck 2016-04-06 11:21:10 UTC
Martin,
is this still relevant?

Comment 10 Martin Sivák 2016-10-17 13:16:43 UTC
Hmm I do not know.. Michal?

Comment 11 Michal Skrivanek 2016-10-17 14:55:18 UTC
That original proposal is not going to get implemented as of now. So we don't really need that. The autoconvergence algorithm in qemu has been improved instead, as well as our own downtime magic in 4.0

Comment 12 Doron Fediuck 2016-11-22 13:32:07 UTC
Closing based on comment 11.
If relevant please reopen with all relevant information.


Note You need to log in before you can comment on or make changes to this bug.