Struct cgroups::blkio::BlkIoController
source · pub struct BlkIoController { /* private fields */ }
Expand description
A controller that allows controlling the blkio
subsystem of a Cgroup.
In essence, using the blkio
controller one can limit and throttle the tasks’ usage of block
devices in the control group.
Implementations
sourceimpl BlkIoController
impl BlkIoController
sourcepub fn new(oroot: PathBuf) -> Self
pub fn new(oroot: PathBuf) -> Self
Constructs a new BlkIoController
with oroot
serving as the root of the control group.
sourcepub fn blkio(&self) -> BlkIo
pub fn blkio(&self) -> BlkIo
Gathers statistics about and reports the state of the block devices used by the control group’s tasks.
sourcepub fn set_leaf_weight(&self, w: u64) -> Result<()>
pub fn set_leaf_weight(&self, w: u64) -> Result<()>
Set the leaf weight on the control group’s tasks, i.e., how are they weighted against the descendant control groups’ tasks.
sourcepub fn set_leaf_weight_for_device(
&self,
major: u64,
minor: u64,
weight: u64
) -> Result<()>
pub fn set_leaf_weight_for_device(
&self,
major: u64,
minor: u64,
weight: u64
) -> Result<()>
Same as set_leaf_weight()
, but settable per each block device.
sourcepub fn reset_stats(&self) -> Result<()>
pub fn reset_stats(&self) -> Result<()>
Reset the statistics the kernel has gathered so far and start fresh.
sourcepub fn throttle_read_bps_for_device(
&self,
major: u64,
minor: u64,
bps: u64
) -> Result<()>
pub fn throttle_read_bps_for_device(
&self,
major: u64,
minor: u64,
bps: u64
) -> Result<()>
Throttle the bytes per second rate of read operation affecting the block device
major:minor
to bps
.
sourcepub fn throttle_read_iops_for_device(
&self,
major: u64,
minor: u64,
iops: u64
) -> Result<()>
pub fn throttle_read_iops_for_device(
&self,
major: u64,
minor: u64,
iops: u64
) -> Result<()>
Throttle the I/O operations per second rate of read operation affecting the block device
major:minor
to bps
.
sourcepub fn throttle_write_bps_for_device(
&self,
major: u64,
minor: u64,
bps: u64
) -> Result<()>
pub fn throttle_write_bps_for_device(
&self,
major: u64,
minor: u64,
bps: u64
) -> Result<()>
Throttle the bytes per second rate of write operation affecting the block device
major:minor
to bps
.
sourcepub fn throttle_write_iops_for_device(
&self,
major: u64,
minor: u64,
iops: u64
) -> Result<()>
pub fn throttle_write_iops_for_device(
&self,
major: u64,
minor: u64,
iops: u64
) -> Result<()>
Throttle the I/O operations per second rate of write operation affecting the block device
major:minor
to bps
.
sourcepub fn set_weight(&self, w: u64) -> Result<()>
pub fn set_weight(&self, w: u64) -> Result<()>
Set the weight of the control group’s tasks.
Trait Implementations
sourceimpl Clone for BlkIoController
impl Clone for BlkIoController
sourcefn clone(&self) -> BlkIoController
fn clone(&self) -> BlkIoController
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more