Struct cgroups::cpuset::CpuSetController
source · pub struct CpuSetController { /* private fields */ }
Expand description
A controller that allows controlling the cpuset
subsystem of a Cgroup.
In essence, this controller is responsible for restricting the tasks in the control group to a set of CPUs and/or memory nodes.
Implementations
sourceimpl CpuSetController
impl CpuSetController
sourcepub fn new(oroot: PathBuf) -> Self
pub fn new(oroot: PathBuf) -> Self
Contructs a new CpuSetController
with oroot
serving as the root of the control group.
sourcepub fn cpuset(&self) -> CpuSet
pub fn cpuset(&self) -> CpuSet
Returns the statistics gathered by the kernel for this control group. See the struct for more information on what information this entails.
sourcepub fn set_cpu_exclusive(&self, b: bool) -> Result<()>
pub fn set_cpu_exclusive(&self, b: bool) -> Result<()>
Control whether the CPUs selected via set_cpus()
should be exclusive to this control
group or not.
sourcepub fn set_mem_exclusive(&self, b: bool) -> Result<()>
pub fn set_mem_exclusive(&self, b: bool) -> Result<()>
Control whether the memory nodes selected via set_memss()
should be exclusive to this control
group or not.
sourcepub fn set_cpus(&self, cpus: &str) -> Result<()>
pub fn set_cpus(&self, cpus: &str) -> Result<()>
Set the CPUs that the tasks in this control group can run on.
Syntax is a comma separated list of CPUs, with an additional extension that ranges can be represented via dashes.
sourcepub fn set_mems(&self, mems: &str) -> Result<()>
pub fn set_mems(&self, mems: &str) -> Result<()>
Set the memory nodes that the tasks in this control group can use.
Syntax is the same as with set_cpus()
.
sourcepub fn set_hardwall(&self, b: bool) -> Result<()>
pub fn set_hardwall(&self, b: bool) -> Result<()>
Controls whether the control group should be “hardwalled”, i.e., whether kernel allocations
should exclusively use the memory nodes set via set_mems()
.
Note that some kernel allocations, most notably those that are made in interrupt handlers may disregard this.
sourcepub fn set_load_balancing(&self, b: bool) -> Result<()>
pub fn set_load_balancing(&self, b: bool) -> Result<()>
Controls whether the kernel should attempt to rebalance the load between the CPUs specified in the
cpus
field of this control group.
sourcepub fn set_rebalance_relax_domain_level(&self, i: i64) -> Result<()>
pub fn set_rebalance_relax_domain_level(&self, i: i64) -> Result<()>
Contorl how much effort the kernel should invest in rebalacing the control group.
See @CpuSet ’s similar field for more information.
sourcepub fn set_memory_migration(&self, b: bool) -> Result<()>
pub fn set_memory_migration(&self, b: bool) -> Result<()>
Control whether when using set_mems()
the existing memory used by the tasks should be
migrated over to the now-selected nodes.
sourcepub fn set_memory_spread_page(&self, b: bool) -> Result<()>
pub fn set_memory_spread_page(&self, b: bool) -> Result<()>
Control whether filesystem buffers should be evenly split across the nodes selected via
set_mems()
.
sourcepub fn set_memory_spread_slab(&self, b: bool) -> Result<()>
pub fn set_memory_spread_slab(&self, b: bool) -> Result<()>
Control whether the kernel’s slab cache for file I/O should be evenly split across the
nodes selected via set_mems()
.
sourcepub fn set_enable_memory_pressure(&self, b: bool) -> Result<()>
pub fn set_enable_memory_pressure(&self, b: bool) -> Result<()>
Control whether the kernel should collect information to calculate memory pressure for control groups.
Note: This will fail with InvalidOperation
if the current congrol group is not the root
control group.
Trait Implementations
sourceimpl Clone for CpuSetController
impl Clone for CpuSetController
sourcefn clone(&self) -> CpuSetController
fn clone(&self) -> CpuSetController
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more