36abd4557c
Taken from the previous version and modified the files for 1.26.1. The following patches were applied cleanly and are included in this commit: enable-support-for-kubernetes-to-ignore-isolcpus.patch kubeadm-create-platform-pods-with-zero-CPU-resources.patch kubelet-CFS-quota-throttling-for-non-integer-cpulimit.patch kubelet-cpumanager-disable-CFS-quota-throttling.patch kubelet-cpumanager-keep-normal-containers-off-reserv.patch kubelet-sort-isolcpus-allocation-when-SMT-enabled.patch Revert-use-subpath-for-coredns-only-for-default-repo.patch The following patches did not apply cleanly. These were ported to kubernetes 1.26.1 and included in this commit: kubelet-cpumanager-infra-pods-use-system-reserved-CP.patch kubelet-cpumanager-introduce-concept-of-isolated-CPU.patch kubernetes-make-isolcpus-allocation-SMT-aware.patch Note: k8s 1.26.1 is not included in ISO yet Test Plan: PASS: Kubernetes package 1.26.1 builds properly. PASS: Run all Kubelet, kubeadm, kubectl make tests for affected code. Story: 2010368 Task: 47395 Signed-off-by: Sachin Gopala Krishna <saching.krishna@windriver.com> Change-Id: I9c8ef9bb036aba503fde0f35ebac08a573375cd3
31 lines
1.7 KiB
Diff
31 lines
1.7 KiB
Diff
From 763da9f5ced5bb40cfc314e0b8199bcf46742f14 Mon Sep 17 00:00:00 2001
|
|
From: Boovan Rajendran <boovan.rajendran@windriver.com>
|
|
Date: Wed, 30 Nov 2022 04:17:19 -0500
|
|
Subject: [PATCH 10/10] kubelet CFS quota throttling for non integer cpulimit
|
|
|
|
Signed-off-by: Boovan Rajendran <boovan.rajendran@windriver.com>
|
|
---
|
|
pkg/kubelet/cm/internal_container_lifecycle_linux.go | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/pkg/kubelet/cm/internal_container_lifecycle_linux.go b/pkg/kubelet/cm/internal_container_lifecycle_linux.go
|
|
index 75406dd8564..05366ab6fcb 100644
|
|
--- a/pkg/kubelet/cm/internal_container_lifecycle_linux.go
|
|
+++ b/pkg/kubelet/cm/internal_container_lifecycle_linux.go
|
|
@@ -39,7 +39,11 @@ func (i *internalContainerLifecycleImpl) PreCreateContainer(pod *v1.Pod, contain
|
|
// Disable cgroup CFS throttle at the container level.
|
|
// /sys/fs/cgroup/cpu/k8s-infra/kubepods/<pod>/<container>/cpu.cfs_quota_us
|
|
// /sys/fs/cgroup/cpu/k8s-infra/kubepods/<pod>/<container>/cpu.cfs_period_us
|
|
- if i.cpuManager.GetCPUPolicy() == "static" && v1qos.GetPodQOS(pod) == v1.PodQOSGuaranteed {
|
|
+ // We can only set CpuQuota to -1 if we're allocating the entire CPU.
|
|
+ // For fractional CPUs the CpuQuota is needed to enforce the limit.
|
|
+ cpuQuantity := container.Resources.Requests[v1.ResourceCPU]
|
|
+ fractionalCpuQuantity := cpuQuantity.MilliValue()%1000
|
|
+ if i.cpuManager.GetCPUPolicy() == "static" && v1qos.GetPodQOS(pod) == v1.PodQOSGuaranteed && fractionalCpuQuantity == 0 {
|
|
containerConfig.Linux.Resources.CpuPeriod = int64(100000)
|
|
containerConfig.Linux.Resources.CpuQuota = int64(-1)
|
|
}
|
|
--
|
|
2.25.1
|
|
|