Skip to content
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

core: consider dedicated cpus when scoring hosts #252

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

ljelinkova
Copy link
Contributor

When the host is scored, its total CPU usage is divided by the number of cores. This works well when all CPUs
are shared because we expect the underlying systems to distribute the load equally.

However, with dedicated CPUs, the load is not equal. We do not really care about the load on the dedicated CPUs as we cannot run any other VM there. We care about the remaining CPUs to see if there is enough resources left for the VMs already running on the host.

@ljelinkova ljelinkova marked this pull request as draft April 8, 2022 13:21
@ljelinkova ljelinkova added the virt label Apr 8, 2022
@ljelinkova ljelinkova requested a review from liranr23 April 8, 2022 13:22
@ljelinkova ljelinkova marked this pull request as ready for review May 3, 2022 11:53
@ljelinkova ljelinkova force-pushed the add-dedicated-to-scoring branch 3 times, most recently from 3e92c48 to c713364 Compare May 6, 2022 13:10
Copy link
Member

@liranr23 liranr23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It's hard to follow on which policies you do count the exclusive CPUs and on which you don't. Can you comment on each policy somewhere to say it explicitly?
  • countThreadsAsCores, when needed should be taken into account.
  • I felt lose of track on variable names. Especially when it's CPU or cores.

Comment on lines 1341 to 1377
public void setSharedCpuCount(int sharedCpuCount) {
this.sharedCpuCount = sharedCpuCount;
}

public int getVmsCoresCount() {
return sharedCpuCount;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it shared CPU count or cores count?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed it to the shared cpu count.

import org.junit.jupiter.api.extension.ExtendWith;
import org.ovirt.engine.core.utils.MockConfigExtension;

@ExtendWith(MockConfigExtension.class)
public class CpuOverloadPolicyUnitTest {
@Test
public void testGetHighUtilizationForAllCores() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we wish to have this test? seems this class is just empty without it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, not really, the tested method was removed. I'll remove the whole class too.

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@ljelinkova ljelinkova force-pushed the add-dedicated-to-scoring branch 2 times, most recently from 5d2754a to 6993809 Compare May 31, 2022 13:00
@ahadas
Copy link
Member

ahadas commented Jun 2, 2022

/ost

When the host is scored, its total CPU usage is divided
by the number of cores. This works well when all CPUs
are shared because we expect the underlying systems to
distribute the load equally.

However, with dedicated CPUs, the load is not equal. We do not
really care about the load on the dedicated CPUs as we cannot run
any other VM there. We care about the remaining CPUs to see
if there is enough resources left for the VMs already running
on the host.

This patch changes the calculation of the host cpu load so that
the load is calcualted only for the shared CPUs.
@ahadas
Copy link
Member

ahadas commented Jun 6, 2022

/ost

@liranr23
Copy link
Member

liranr23 commented Jun 6, 2022

A general question:
It seems, like previously discussed, that the current policies will look only on shared CPUs. But, exclusive CPU VMs also able to migrate. When breaking some policy and the engine triggers a migration that might happen, right?
I am a bit confused again on which policy needs what.
Also, will we score hosts based on exclusive VMs? For example CpuAndNumaPinningWeightPolicyUnit?

@ahadas
Copy link
Member

ahadas commented Jun 7, 2022

A general question: It seems, like previously discussed, that the current policies will look only on shared CPUs. But, exclusive CPU VMs also able to migrate. When breaking some policy and the engine triggers a migration that might happen, right? I am a bit confused again on which policy needs what. Also, will we score hosts based on exclusive VMs? For example CpuAndNumaPinningWeightPolicyUnit?

@liranr23 can you please rephrase the question?

@ahadas ahadas merged commit db6458e into oVirt:master Jun 7, 2022
@ljelinkova ljelinkova deleted the add-dedicated-to-scoring branch June 15, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants