Struct cgroups_rs::cpu::CpuController [−][src]
pub struct CpuController { /* fields omitted */ }
Expand description
A controller that allows controlling the cpu
subsystem of a Cgroup.
In essence, it allows gathering information about how much the tasks inside the control group are using the CPU and creating rules that limit their usage. Note that this crate does not yet support managing realtime tasks.
Implementations
Contructs a new CpuController
with root
serving as the root of the control group.
Returns CPU time statistics based on the processes in the control group.
Configures the CPU bandwidth (in relative relation to other control groups and this control group’s parent).
For example, setting control group A
’s shares
to 100
, and control group B
’s
shares
to 200
ensures that control group B
receives twice as much as CPU bandwidth.
(Assuming both A
and B
are of the same parent)
Retrieve the CPU bandwidth that this control group (relative to other control groups and this control group’s parent) can use.
Specify a period (when using the CFS scheduler) of time in microseconds for how often this control group’s access to the CPU should be reallocated.
Retrieve the period of time of how often this cgroup’s access to the CPU should be reallocated in microseconds.
Specify a quota (when using the CFS scheduler) of time in microseconds for which all tasks
in this control group can run during one period (see: set_cfs_period()
).
Retrieve the quota of time for which all tasks in this cgroup can run during one period, in microseconds.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for CpuController
impl Send for CpuController
impl Sync for CpuController
impl Unpin for CpuController
impl UnwindSafe for CpuController
Blanket Implementations
Mutably borrows from an owned value. Read more
Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.
Attach a task to this controller by thread group id.