Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions libcontainer/factory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ func InitArgs(args ...string) func(*LinuxFactory) error {
}
}

// IntelRdtfs is an options func to configure a LinuxFactory to return
// IntelRdtFs is an options func to configure a LinuxFactory to return
// containers that use the Intel RDT "resource control" filesystem to
// create and manage Intel RDT resources (e.g., L3 cache, memory bandwidth).
func IntelRdtFs(l *LinuxFactory) error {
if !intelrdt.IsCATEnabled() && !intelrdt.IsMBAEnabled() {
l.NewIntelRdtManager = nil
if intelrdt.IsCATEnabled() || intelrdt.IsMBAEnabled() {
l.NewIntelRdtManager = intelrdt.NewManager
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW; wondering why NewIntelRdtManager (and other fields in LinuxFactory are exported; perhaps they should not be)

} else {
l.NewIntelRdtManager = func(config *configs.Config, id string, path string) intelrdt.Manager {
return intelrdt.NewManager(config, id, path)
}
l.NewIntelRdtManager = nil
}
return nil
}
Expand Down
4 changes: 1 addition & 3 deletions utils_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ func loadFactory(context *cli.Context) (libcontainer.Factory, error) {
return nil, err
}

intelRdtManager := libcontainer.IntelRdtFs

// We resolve the paths for {newuidmap,newgidmap} from the context of runc,
// to avoid doing a path lookup in the nsexec context. TODO: The binary
// names are not currently configurable.
Expand All @@ -46,7 +44,7 @@ func loadFactory(context *cli.Context) (libcontainer.Factory, error) {
newgidmap = ""
}

return libcontainer.New(abs, intelRdtManager,
return libcontainer.New(abs, libcontainer.IntelRdtFs,
libcontainer.CriuPath(context.GlobalString("criu")),
libcontainer.NewuidmapPath(newuidmap),
libcontainer.NewgidmapPath(newgidmap))
Expand Down