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 <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2021-12-14 22:46:38 -08:00
parent f10cd679eb
commit a673b64864

View File

@ -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))
}