Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder will allow building of cpuset fields such as cpuset.cpus and cpuset.mems
Example:
cset := cpuset.Builder{}. AddCPU(0). AddMemRange(0). Build() fcClient, err := fcclient.New(containerdTTRPCAddress) if err != nil { return err } defer fcClient.Close() vmID := "cpuset-builder-example" createVMRequest := &proto.CreateVMRequest{ VMID: vmID, JailerConfig: proto.JailerConfig{ CPUs: cset.CPUs(), Mems: cset.Mems(), }, } _, err = fcClient.CreateVM(ctx, createVMRequest) if err != nil { return errors.Wrap(err, "failed to create VM") }
func (Builder) AddCPU ¶
AddCPU will add the physical CPU number that the process is allowed to run on.
func (Builder) AddCPURange ¶
AddCPURange adds a range of physical CPU numbers that the process is allowed to run on
func (Builder) AddMemRange ¶
AddMemRange adds a range of memory nodes to be used.
type CPUSet ¶
type CPUSet struct {
// contains filtered or unexported fields
}
CPUSet represents the linux CPUSet which is a series of configurable values that allow processes to run on a specific CPUs and those CPUs are then bound to the memory nodes specified.
More information can be found here: http://man7.org/linux/man-pages/man7/cpuset.7.html
Click to show internal directories.
Click to hide internal directories.