[][src]Struct cgroups_rs::cpuset::CpuSetController

pub struct CpuSetController { /* fields omitted */ }

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

impl CpuSetController[src]

pub fn new(root: PathBuf, v2: bool) -> Self[src]

Contructs a new CpuSetController with root serving as the root of the control group.

pub fn cpuset(&self) -> CpuSet[src]

Returns the statistics gathered by the kernel for this control group. See the struct for more information on what information this entails.

pub fn set_cpu_exclusive(&self, b: bool) -> Result<()>[src]

Control whether the CPUs selected via set_cpus() should be exclusive to this control group or not.

pub fn set_mem_exclusive(&self, b: bool) -> Result<()>[src]

Control whether the memory nodes selected via set_memss() should be exclusive to this control group or not.

pub fn set_cpus(&self, cpus: &str) -> Result<()>[src]

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.

pub fn set_mems(&self, mems: &str) -> Result<()>[src]

Set the memory nodes that the tasks in this control group can use.

Syntax is the same as with set_cpus().

pub fn set_hardwall(&self, b: bool) -> Result<()>[src]

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.

pub fn set_load_balancing(&self, b: bool) -> Result<()>[src]

Controls whether the kernel should attempt to rebalance the load between the CPUs specified in the cpus field of this control group.

pub fn set_rebalance_relax_domain_level(&self, i: i64) -> Result<()>[src]

Contorl how much effort the kernel should invest in rebalacing the control group.

See @CpuSet 's similar field for more information.

pub fn set_memory_migration(&self, b: bool) -> Result<()>[src]

Control whether when using set_mems() the existing memory used by the tasks should be migrated over to the now-selected nodes.

pub fn set_memory_spread_page(&self, b: bool) -> Result<()>[src]

Control whether filesystem buffers should be evenly split across the nodes selected via set_mems().

pub fn set_memory_spread_slab(&self, b: bool) -> Result<()>[src]

Control whether the kernel's slab cache for file I/O should be evenly split across the nodes selected via set_mems().

pub fn set_enable_memory_pressure(&self, b: bool) -> Result<()>[src]

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

impl Clone for CpuSetController[src]

impl Debug for CpuSetController[src]

impl<'a> From<&'a Subsystem> for &'a CpuSetController[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Controller for T where
    T: ControllerInternal, 
[src]

pub fn apply(&Self, &Resources) -> Result<(), Error>[src]

Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.

pub fn create(&Self)[src]

Create this controller

pub fn set_notify_on_release(&Self, bool) -> Result<(), Error>[src]

Set notify_on_release

pub fn set_release_agent(&Self, &str) -> Result<(), Error>[src]

Set release_agent

pub fn exists(&Self) -> bool[src]

Does this controller already exist?

pub fn delete(&Self) -> Result<(), Error>[src]

Delete the controller.

pub fn add_task(&Self, &CgroupPid) -> Result<(), Error>[src]

Attach a task to this controller.

pub fn add_task_by_tgid(&Self, &CgroupPid) -> Result<(), Error>[src]

Attach a task to this controller by thread group id.

pub fn tasks(&Self) -> Vec<CgroupPid, Global>[src]

Get the list of tasks that this controller has.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.