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: Change the CPUPolicyUnit for dedicated cpu pinning #299

Merged
merged 1 commit into from
May 26, 2022

Commits on May 24, 2022

  1. core: Change the CPUPolicyUnit for dedicated pinning

    Before the introduction of the exclusively pinned CPUs,
    the logic of CPUPolicyUnit allowed to check the filtering
    constraints for each VM in the vm group individually. The
    constraint was that the number of VM's CPUs had to be >=
    host CPUs.
    
    With the introduction of the exclusively pinned CPUs, that is
    no more possible - if the group contained VMs with both, shared
    and exclusively pinned CPUs, we need to calculate the CPU count
    constraints for the whole group (similar to huge pages in
    HugePagesFilterPolicyUnit).
    
    Now the algorithm for calculating if the vm group fits into
    the host is as follows:
    1. Calculate the host CPU count
    2. Calculate the currently exclusively pinned CPUs (including pending)
    3. Pin the vms that are being schedulled and count how many CPUs will be taken
    4. Calculate how many shared CPUs are required to be left on the host
       as the maximum of required shared CPUs for vmGroup, pending VMs and running VMs.
    
    The host can fit the VMs if:
    hostCpuCount - exclusiveCpus - maxSharedCpuCount >= 0
    
    Note that the calculation of the previous values may differ based on
    the cluster setting of "Count threads as cores".
    ljelinkova committed May 24, 2022
    Configuration menu
    Copy the full SHA
    bfc1395 View commit details
    Browse the repository at this point in the history