Skip to content

Commit

Permalink
wip no need to export
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Mar 16, 2022
1 parent 9e8d266 commit 252cb97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions client/lib/cgutil/cpuset_manager_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 8 additions & 8 deletions drivers/docker/reconcile_cpuset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{} {
Expand All @@ -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
Expand Down

0 comments on commit 252cb97

Please sign in to comment.