Skip to content

Commit a2fb02e

Browse files
authored
Merge pull request #4243 from ndixita/memory-qos
KEP-2570: Updating Memory QoS status to eventually deprecate the alpha feature
2 parents c6e3693 + 03a7273 commit a2fb02e

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

keps/sig-node/2570-memory-qos/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# KEP-2570: Support Memory QoS with cgroups v2
22
<!-- toc -->
33
- [Release Signoff Checklist](#release-signoff-checklist)
4+
- [Latest Update [Stalled]](#latest-update-stalled)
45
- [Summary](#summary)
56
- [Motivation](#motivation)
67
- [Goals](#goals)
@@ -65,6 +66,27 @@
6566
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
6667
- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
6768

69+
## Latest Update [Stalled]
70+
71+
Work around Memory QoS has been halted because of the issues uncovered during the beta promotion process
72+
in K8s 1.28. This section is added to document the valuable lessons learned from this experience.
73+
74+
Initial Plan: Use cgroup v2 memory.high knob to set memory throttling limit. As per the initial understanding,
75+
setting memory.high would have caused memory allocation to be slowed down once the memory usage level in the containers
76+
reached `memory.high` level. When memory usage keeps goes beyond memory.max, kernel will trigger OOM Kill.
77+
78+
Actual Finding: According to the the [test results](https://docs.google.com/document/d/1mY0MTT34P-Eyv5G1t_Pqs4OWyIH-cg9caRKWmqYlSbI/edit?usp=sharing), it was observed that for a container process trying to allocate large chunks of memory, once the memory.high level is reached,
79+
it doesn't progress further and stays stuck indefinitely. Upon investigating further, it was observed that when memory usage
80+
within a cgroup reaches the memory.high level, the kernel initiates memory reclaim as expected. However the process gets stuck
81+
because its memory consumption rate is faster than what the memory reclaim can recover. This creates a livelock situation where
82+
the process rapidly consumes the memory reclaimed by the kernel causing the memory usage to reach memory.high level again,
83+
leading to another round of memory reclaimation by the kernel. By increasingly slowing growth in memory usage, it becomes
84+
harder and harder for workloads to reach the memory.max intervention point. (Ref: https://lkml.org/lkml/2023/6/1/1300)
85+
86+
Future: memory.high can be used to implement kill policies in for userspace OOMs, together with [Pressure Stall Information](https://docs.kernel.org/accounting/psi.html)
87+
(PSI). When the workloads are in stuck after their memory usage levels reach memory.high, high PSI can be used by userspace OOM policy to kill such workload(s).
88+
89+
6890
## Summary
6991
Support memory qos with cgroups v2.
7092

keps/sig-node/2570-memory-qos/kep.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ reviewers:
1111
approvers:
1212
- "@derekwaynecarr"
1313
owning-sig: sig-node
14-
status: implementable
14+
status: provisional
1515
editor: "@ndixita"
1616
creation-date: 2021-03-14
1717
last-updated: 2023-06-14
18-
stage: beta
19-
latest-milestone: "v1.28"
18+
stage: alpha
19+
latest-milestone: "v1.27"
2020
milestone:
2121
alpha: "v1.27"
22-
beta: "v1.28"
2322
feature-gates:
2423
- name: MemoryQoS
2524
components:

0 commit comments

Comments
 (0)