From e66a0e41acc156edc6513843bf2b84232c8ba34c Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Mon, 14 Mar 2022 12:51:41 -0500 Subject: [PATCH] wip no need to export --- client/lib/cgutil/cpuset_manager_v2.go | 6 +++--- drivers/docker/reconcile_cpuset.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/lib/cgutil/cpuset_manager_v2.go b/client/lib/cgutil/cpuset_manager_v2.go index 2186850a81b..94367d25a0a 100644 --- a/client/lib/cgutil/cpuset_manager_v2.go +++ b/client/lib/cgutil/cpuset_manager_v2.go @@ -55,9 +55,9 @@ type cpusetManagerV2 struct { initial cpuset.CPUSet // set of initial cores (never changes) lock sync.RWMutex // hold this with regard to tracking fields - pool cpuset.CPUSet // cores being shared among across all tasks - sharing map[identifier]nothing // sharing tasks which use only cpus in the pool - isolating map[identifier]cpuset.CPUSet // remember which task goes where to avoid context switching + pool cpuset.CPUSet // cores being shared among all tasks + sharing map[identifier]nothing // sharing tasks which use only shared cores in the pool + isolating map[identifier]cpuset.CPUSet // isolating tasks which use reserved + shared cores } func NewCpusetManagerV2(parent string, logger hclog.Logger) CpusetManager { diff --git a/drivers/docker/reconcile_cpuset.go b/drivers/docker/reconcile_cpuset.go index 1586d8035bb..091c107ed4c 100644 --- a/drivers/docker/reconcile_cpuset.go +++ b/drivers/docker/reconcile_cpuset.go @@ -87,17 +87,17 @@ func (cf *cpusetFixer) fix(c coordinate) { } type coordinate struct { - ContainerID string - AllocID string - Task string + containerID string + allocID string + task string } func (c coordinate) NomadScope() string { - return cgutil.CgroupID(c.AllocID, c.Task) + return cgutil.CgroupID(c.allocID, c.task) } func (c coordinate) DockerScope() string { - return fmt.Sprintf("docker-%s.scope", c.ContainerID) + return fmt.Sprintf("docker-%s.scope", c.containerID) } func (d *Driver) trackedTasks() map[coordinate]struct{} { @@ -107,9 +107,9 @@ func (d *Driver) trackedTasks() map[coordinate]struct{} { m := make(map[coordinate]struct{}, len(d.tasks.store)) for _, h := range d.tasks.store { m[coordinate{ - ContainerID: h.containerID, - AllocID: h.task.AllocID, - Task: h.task.Name, + containerID: h.containerID, + allocID: h.task.AllocID, + task: h.task.Name, }] = struct{}{} } return m