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

Reduce CPU pinning fragmentation #384

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Conversation

liranr23
Copy link
Member

This patch sorts the VM list on schedule phase before doing the
dedicated CPU pinning.
This change tries to reduce the fragmentation that may be caused when
allocating a smaller VM in terms of the policy and CPU topology (a less
restricted) when having a bigger one. Scheduling the smaller VM first
may cause less physical resources needed by the larger VM because we try
to enhance performance in the allocation logic.
Now, the VMs will be sorted based on the policy first and if needed by
the CPU topology, letting the more restricted VM to be scheduled first.

Change-Id: Ia3fc28511c147d43da9cf8d86d50ca17f1e3f0e1
Signed-off-by: Liran Rotenberg lrotenbe@redhat.com

@liranr23
Copy link
Member Author

A bit note:
In this patch the sort for the canSchedule() is not executed.
Taken from PR #380

Copy link
Contributor

@ljelinkova ljelinkova left a comment

Choose a reason for hiding this comment

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

Usually, I am a bit skeptical about the usefulness of the unit tests but in case of the VmsCpuPinningPolicyComparator I think it might be actually useful to provide some VMs and see what is the expected output for different pinning, pinning policies and topologies.

@ahadas
Copy link
Member

ahadas commented May 23, 2022

Usually, I am a bit skeptical about the usefulness of the unit tests but in case of the VmsCpuPinningPolicyComparator I think it might be actually useful to provide some VMs and see what is the expected output for different pinning, pinning policies and topologies.

yeah, in this case it will also serve as a documentation

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.

I've commented on #380

Copy link
Member Author

@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.

I moved all the sort related discussions to this PR.

@liranr23
Copy link
Member Author

liranr23 commented Jun 2, 2022

Based on the offline discussion:

  1. Sort will happen within groupVms(), to be used once for both canScheudle() and schedule().
  2. The sort will be made as following:
  • Policy (in the order of Manual, resize and pin, isolate-threads, dedicated, none).
  • Number of CPUs
  • Threads
  • Cores
  • Sockets

@liranr23
Copy link
Member Author

liranr23 commented Jun 2, 2022

Need to verify, and add unit tests. But this is how it looks now.

@liranr23 liranr23 force-pushed the order_schedule_vms branch 2 times, most recently from a03ea57 to dbcb0cd Compare June 2, 2022 15:42
@liranr23 liranr23 force-pushed the order_schedule_vms branch 2 times, most recently from 1ea8bcd to 2076b6a Compare June 6, 2022 17:09
This patch sorts the VM list on schedule phase before doing the
dedicated CPU pinning.
This change tries to reduce the fragmentation that may be caused when
allocating a smaller VM in terms of the policy and CPU topology (a less
restricted) when having a bigger one. Scheduling the smaller VM first
may cause less physical resources needed by the larger VM because we try
to enhance performance in the allocation logic.
Now, the VMs will be sorted based on the policy first and if needed by
the CPU topology, letting the more restricted VM to be scheduled first.

Change-Id: Ia3fc28511c147d43da9cf8d86d50ca17f1e3f0e1
Signed-off-by: Liran Rotenberg <lrotenbe@redhat.com>
@liranr23
Copy link
Member Author

liranr23 commented Jun 7, 2022

/ost

@liranr23
Copy link
Member Author

liranr23 commented Jun 8, 2022

OST failed on UI test, unrelated to the patch.

@ahadas ahadas merged commit d5cea95 into oVirt:master Jun 9, 2022
@liranr23 liranr23 deleted the order_schedule_vms branch June 13, 2022 06:35
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