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

balloons: improve handling of containers with no CPU requests #386

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

askervin
Copy link
Collaborator

Containers without CPU requests always pile up to the first balloon where they fit.

This patch enables having multiple balloons in the system so that this kind of containers will be spread equally into them.

This patch is an enabler to fix the issue #385.

- Change chooseBalloonInstance() to fillableBalloonInstances()
  returning multiple balloon instances that can be chosen.

- Add a separate logic for choosing a balloon instance among fillable
  ones. This changes current container-to-balloon assigning
  behavior. Instead of choosing the first balloon instance where a
  container fits, now choose the one with most room in it, and secondly,
  least containers in it.

This fixes the issue in the earlier logic that caused containers
without CPU requests to always pile up in the same balloons. Now they
are spread evenly to several balloons that have the same amount of
free CPUs.

Signed-off-by: Antti Kervinen <[email protected]>
If a new balloon is created for a container that has no CPU requests,
CPU allocation of "requested" 0 CPUs succeeds without allocating
anything. That would lead to a balloon with empty cpuset, that is, no
CPU pinning for containers in it.

Signed-off-by: Antti Kervinen <[email protected]>
Copy link
Collaborator

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

LGTM

@klihub klihub merged commit f81e8ea into containers:main Oct 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants