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
Fix a bug whereby reusable CPUs and devices were not being honored #93189
Fix a bug whereby reusable CPUs and devices were not being honored #93189
Conversation
/milestone 1.19 |
@derekwaynecarr: The provided milestone is not valid for this repository. Milestones in this repository: [ Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/milestone v1.19 |
we should prepare a cherrypick for this as well. /approve |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
5bd96a2
to
b101e89
Compare
b101e89
to
6a3b5c0
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, 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 |
6a3b5c0
to
5ba6f81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small nits. LGTM otherwise
@@ -33,6 +33,7 @@ type BitMask interface { | |||
IsEqual(mask BitMask) bool | |||
IsEmpty() bool | |||
IsSet(bit int) bool | |||
AnySet(bitss []int) bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: /bitss/bits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -120,6 +121,16 @@ func (s *bitMask) IsSet(bit int) bool { | |||
return (*s & (1 << uint64(bit))) > 0 | |||
} | |||
|
|||
// AnysSet checks bit in mask to see if any provided bit is set to one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: /AnysSet/AnySet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Previously, it was possible for reusable CPUs and reusable devices (i.e. those previously consumed by init containers) to not be reused by subsequent init containers or app containers if the TopologyManager was enabled. This would happen because hint generation for the TopologyManager was not considering the reusable devices when it made its hint calculation. As such, it would sometimes: 1) Generate a hint for a differnent NUMA node, causing the CPUs and devices to be allocated from that node instead of the one where the reusable devices live; or 2) End up thinking there were not enough CPUs or devices to allocate and throw a TopologyAffinity admission error This patch fixes this by ensuring that reusable CPUs and devices are considered as part of TopologyHint generation. This frunctionality is difficult to unit test since it spans multiple components, but an e2e test will be added in a subsequent patch to test this functionality.
5ba6f81
to
00df26a
Compare
/lgtm |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
1 similar comment
/retest |
…9-upstream-release-1.18 Automated cherry pick of #93189: Add AnySet() to topologymanager bitmask API
… being honored xref https://bugzilla.redhat.com/show_bug.cgi?id=1868634 xref kubernetes#93189 Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Previously, it was possible for reusable CPUs and reusable devices (i.e.
those previously consumed by init containers) to not be reused by
subsequent init containers or app containers if the TopologyManager was
enabled. This would happen because hint generation for the
TopologyManager was not considering the reusable devices when it made
its hint calculation.
As such, it would sometimes:
devices to be allocated from that node instead of the one where the
reusable devices live; or
throw a TopologyAffinity admission error
This patch fixes this by ensuring that reusable CPUs and devices are
considered as part of TopologyHint generation. This frunctionality is
difficult to unit test since it spans multiple components, but an e2e
test will be added in a subsequent patch to test this functionality.
Does this PR introduce a user-facing change?: