From a673b64864924d3ae8e4e781f44fbf691e4262ac Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 14 Dec 2021 22:46:38 -0800 Subject: [PATCH] kubelet/cm: speed up cgroup creation There's no need to call m.Update (which will create another instance of libcontainer cgroup manager, convert all the resources and then set them). All this is already done here, except for Set(). Signed-off-by: Kir Kolyshkin --- pkg/kubelet/cm/cgroup_manager_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/cm/cgroup_manager_linux.go b/pkg/kubelet/cm/cgroup_manager_linux.go index 230173690d5..c64067a3712 100644 --- a/pkg/kubelet/cm/cgroup_manager_linux.go +++ b/pkg/kubelet/cm/cgroup_manager_linux.go @@ -534,7 +534,7 @@ func (m *cgroupManagerImpl) Create(cgroupConfig *CgroupConfig) error { // it may confuse why we call set after we do apply, but the issue is that runc // follows a similar pattern. it's needed to ensure cpu quota is set properly. - if err := m.Update(cgroupConfig); err != nil { + if err := manager.Set(resources); err != nil { utilruntime.HandleError(fmt.Errorf("cgroup update failed %v", err)) }