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

Update strategy used to reuse CPUs from init containers in CPUManager #90419

Merged

Conversation

klueska
Copy link
Contributor

@klueska klueska commented Apr 23, 2020

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind api-change

/kind bug

/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:
With the old strategy, it was possible for an init container to end up
running without some of its CPUs being exclusive if it requested more
guaranteed CPUs than the sum of all guaranteed CPUs requested by app
containers. Unfortunately, this case was not caught by our unit tests
because they didn't validate the state of the defaultCPUSet to ensure
there was no overlap with CPUs assigned to containers. This patch
updates the strategy to reuse the CPUs assigned to init containers
across into app containers, while avoiding this edge case. It also
updates the unit tests to now catch this type of error in the future.

Does this PR introduce a user-facing change?:

Fixes regression in CPUManager that had the (rare) possibility to release exclusive CPUs in app containers inherited from init containers. 

With the old strategy, it was possible for an init container to end up
running without some of its CPUs being exclusive if it requested more
guaranteed CPUs than the sum of all guaranteed CPUs requested by app
containers. Unfortunately, this case was not caught by our unit tests
because they didn't validate the state of the defaultCPUSet to ensure
there was no overlap with CPUs assigned to containers. This patch
updates the strategy to reuse the CPUs assigned to init containers
across into app containers, while avoiding this edge case. It also
updates the unit tests to now catch this type of error in the future.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 23, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: klueska

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from vishh and yifan-gu April 23, 2020 20:55
@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 23, 2020
@mattjmcnaughton
Copy link
Contributor

mattjmcnaughton commented Apr 25, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: klueska

The full list of commands accepted by this bot can be found here.

The pull request process is described here
Needs approval from an approver in each of these files:

* ~[pkg/kubelet/cm/cpumanager/OWNERS](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/cm/cpumanager/OWNERS)~ [klueska]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/assign @sjenning

@klueska my apologies if I'm missing something obvious here... but do you know why its counting you as a "approver"? From the OWNERS file, it looks like you're a reviewer (https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/cm/cpumanager/OWNERS)? Trying to figure out if we need to report a bug to the k8s-ci-robot folks :)

@klueska
Copy link
Contributor Author

klueska commented Apr 25, 2020

@klueska my apologies if I'm missing something obvious here... but do you know why its counting you as a "approver"? From the OWNERS file, it looks like you're a reviewer

@mattjmcnaughton I am an approver in pkg/kubelet/cm which makes me an approver here as well by inheritance

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 25, 2020
@mattjmcnaughton
Copy link
Contributor

mattjmcnaughton commented Apr 25, 2020 via email

@nolancon
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2020
@k8s-ci-robot k8s-ci-robot merged commit 561b2ab into kubernetes:master Apr 27, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Apr 27, 2020
k8s-ci-robot added a commit that referenced this pull request May 30, 2020
…9-upstream-release-1.18

Automated cherry pick of #90419: Update strategy used to reuse CPUs from init containers in
cynepco3hahue pushed a commit to cynepco3hahue/kubernetes that referenced this pull request Jun 2, 2020
…able-cpus-strategy

Update strategy used to reuse CPUs from init containers in CPUManager
cynepco3hahue pushed a commit to cynepco3hahue/origin that referenced this pull request Jun 10, 2020
…ners in CPUManager

ref: kubernetes/kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
cynepco3hahue pushed a commit to cynepco3hahue/origin that referenced this pull request Jun 10, 2020
…ners in CPUManager

ref: kubernetes/kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
cynepco3hahue pushed a commit to cynepco3hahue/origin that referenced this pull request Jun 10, 2020
…ers in CPUManager

ref: kubernetes/kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
cynepco3hahue pushed a commit to cynepco3hahue/origin that referenced this pull request Jul 12, 2020
…ers in CPUManager

ref: kubernetes/kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
cynepco3hahue pushed a commit to cynepco3hahue/origin that referenced this pull request Jul 20, 2020
…ers in CPUManager

ref: kubernetes/kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
cynepco3hahue pushed a commit to cynepco3hahue/origin that referenced this pull request Jul 23, 2020
…ers in CPUManager

ref: kubernetes/kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Sep 26, 2020
…ers in CPUManager

ref: kubernetes#90419

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>

Origin-commit: 0f5abeec3de35b44c1d79ff320b40281b13de060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants