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

KEP-4885: Windows CPU and Memory Affinity #4888

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jsturtevant
Copy link
Contributor

  • One-line PR description: Add CPU and memory Affinity support to Windows nodes with CPUManager, MemoryManager and Topology manager
  • Other comments:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory labels Sep 30, 2024
@k8s-ci-robot k8s-ci-robot added sig/windows Categorizes an issue or PR as relevant to SIG Windows. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 30, 2024
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 30, 2024
@jsturtevant jsturtevant force-pushed the windows-topology-managers branch 2 times, most recently from 593f44b to 0ecf8b5 Compare September 30, 2024 21:33
Signed-off-by: James Sturtevant <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 30, 2024
@kiashok
Copy link
Contributor

kiashok commented Oct 1, 2024

lgtm

Thanks for opening this @jsturtevant

Signed-off-by: James Sturtevant <[email protected]>
@marosset
Copy link
Contributor

marosset commented Oct 1, 2024

/milestone v1.32

@k8s-ci-robot k8s-ci-robot added this to the v1.32 milestone Oct 1, 2024
Signed-off-by: James Sturtevant <[email protected]>
Copy link
Contributor

@aravindhp aravindhp left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for working on this, @jsturtevant

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jsturtevant, kevpar
Once this PR has been reviewed and has the lgtm label, please assign jpbetz for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

No objections for cpumanager and topologymanager, we can use some tunings on the KEP but looks straightforward and uncontroversial. I have some concerns about memory manager, let's iterate over there

For sig-windows, we also see a risk to enabling a feature that has already Stable or fully featured on Linux. To mitigate this risk we have opted to create a
separate KEP with a feature flag so we can communicate our status effectively.

Another risk is the testing implementation for these features is mostly in e2e_node which doesn't currently support Windows. As a mitigation there was [some exploration ](https://github.com/jsturtevant/kubernetes/tree/e2e_node-windows) to see if these tests could be enabled on Windows so we can progress this feature with confidence in the testing suite.
Copy link
Contributor

Choose a reason for hiding this comment

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

e2e tests are "just" suggested for alpha, while they are beta blockers. I have no objections about starting this work in alpha with unit tests (which all need to run and pass on windows, though, but we should be here already) and work in parallel to enable e2e testing on windows.

Comment on lines +333 to +334
On Windows systems with more than 64 cores the CPU's will be split into groups,
each processor is identified by its group number and its group-relative processor number.
Copy link
Contributor

Choose a reason for hiding this comment

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

is this grouping somehow related to HW topology or is completely independent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

independent, though NUMA nodes will not span across groups.

NOTE: Also set `disable-supported` to `true` or `false` in `kep.yaml`.
-->

Yes. Restarting of the pods will be required to remove the CPU/Memory affinity.
Copy link
Contributor

Choose a reason for hiding this comment

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

OTOH running workload are not expected to be affected by both kubelet restart and downgrade once the feature was enabled and then disabled (right?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a kubelet restart shouldn't affect running workloads.

[supported limits]: https://git.k8s.io/community//sig-scalability/configs-and-limits/thresholds.md
-->

We will monitor for cpu consumption to query the CPU topology. If required we may wish to implement a caching strategy.
Copy link
Contributor

Choose a reason for hiding this comment

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

on linux the HW topology is read only once at kublet start, but there are plans to enable dynamic node resizing. Let's keep that into account when designing the windows solution

Copy link
Contributor Author

Choose a reason for hiding this comment

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

During testing I was seeing repeat calls to the cadvisor.getMachineInfo() method, which is why I mention this here.

Copy link
Contributor

Choose a reason for hiding this comment

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

fair enough, and worth a deeper dive

Signed-off-by: James Sturtevant <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 2, 2024

## Infrastructure Needed (Optional)

<!--
Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of nodes would you need to test this features for windows?

How are you envisioning a e2e test for these features given that windows does not have e2e_node?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see sig-windows re-using the existing testing infra and adding some basic tests in https://github.com/kubernetes/kubernetes/tree/master/test/e2e/windows for alpha to ensure the features work.


##### e2e tests

- e2e_node will need to be enabled for windows to add coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be a very important point. Are you okay with blocking this feature based on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal would be to enable this for Beta. I don't see a sustainable way for sig-windows to enable enough tests to ensure quality for these features without leveraging existing tests. Duplicating all the test in e2e for windows would be a large undertaking as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it should be clear that you intend to add a e2e_node like test for this one. I read this as we are going to enable all of the tests as part of this feature..

###### How can someone using this feature know that it is working for their instance?

- [x] Events
- Event Reason:
Copy link
Contributor

Choose a reason for hiding this comment

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

What events?

On Windows systems with more than 64 cores the CPU's will be split into groups,
each processor is identified by its group number and its group-relative processor number.

In Cri we will add the following structure to the `WindowsContainerResources` in CRI:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In Cri we will add the following structure to the `WindowsContainerResources` in CRI:
In CRI we will add the following structure to the `WindowsContainerResources` in CRI:


This kep outlines how to add support for the CPU, Memory and Topology Managers in kubelet for Windows.
The Managers are already available and support in kubelet on Linux and there have been requests to sig-windows
to add support on Windows to help with workloads that require co-located workloads. The goal of the kep is to
Copy link
Member

Choose a reason for hiding this comment

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

KEP

This kep outlines how to add support for the CPU, Memory and Topology Managers in kubelet for Windows.
The Managers are already available and support in kubelet on Linux and there have been requests to sig-windows
to add support on Windows to help with workloads that require co-located workloads. The goal of the kep is to
add Windows support without significant changes to the Managers logic while providing the same feature sets available
Copy link
Member

Choose a reason for hiding this comment

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

would be helpful to link the actual functionality KEP and documentation for reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

9 participants