Struct cgroups_rs::hugetlb::HugeTlbController
source · pub struct HugeTlbController { /* private fields */ }Expand description
A controller that allows controlling the hugetlb subsystem of a Cgroup.
In essence, using this controller it is possible to limit the use of hugepages in the tasks of the control group.
Implementations§
source§impl HugeTlbController
impl HugeTlbController
sourcepub fn new(root: PathBuf, v2: bool) -> Self
pub fn new(root: PathBuf, v2: bool) -> Self
Constructs a new HugeTlbController with root serving as the root of the control group.
sourcepub fn size_supported(&self, hugetlb_size: &str) -> bool
pub fn size_supported(&self, hugetlb_size: &str) -> bool
Whether the system supports hugetlb_size hugepages.
pub fn get_sizes(&self) -> Vec<String>
sourcepub fn failcnt(&self, hugetlb_size: &str) -> Result<u64>
pub fn failcnt(&self, hugetlb_size: &str) -> Result<u64>
Check how many times has the limit of hugetlb_size hugepages been hit.
sourcepub fn limit_in_bytes(&self, hugetlb_size: &str) -> Result<u64>
pub fn limit_in_bytes(&self, hugetlb_size: &str) -> Result<u64>
Get the limit (in bytes) of how much memory can be backed by hugepages of a certain size
(hugetlb_size).
sourcepub fn usage_in_bytes(&self, hugetlb_size: &str) -> Result<u64>
pub fn usage_in_bytes(&self, hugetlb_size: &str) -> Result<u64>
Get the current usage of memory that is backed by hugepages of a certain size
(hugetlb_size).
sourcepub fn max_usage_in_bytes(&self, hugetlb_size: &str) -> Result<u64>
pub fn max_usage_in_bytes(&self, hugetlb_size: &str) -> Result<u64>
Get the maximum observed usage of memory that is backed by hugepages of a certain size
(hugetlb_size).
Trait Implementations§
source§impl Clone for HugeTlbController
impl Clone for HugeTlbController
source§fn clone(&self) -> HugeTlbController
fn clone(&self) -> HugeTlbController
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for HugeTlbController
impl Debug for HugeTlbController
source§impl<'a> From<&'a Subsystem> for &'a HugeTlbController
impl<'a> From<&'a Subsystem> for &'a HugeTlbController
source§fn from(sub: &'a Subsystem) -> &'a HugeTlbController
fn from(sub: &'a Subsystem) -> &'a HugeTlbController
Auto Trait Implementations§
impl RefUnwindSafe for HugeTlbController
impl Send for HugeTlbController
impl Sync for HugeTlbController
impl Unpin for HugeTlbController
impl UnwindSafe for HugeTlbController
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Controller for Twhere
T: ControllerInternal,
impl<T> Controller for Twhere T: ControllerInternal,
source§fn apply(&self, res: &Resources) -> Result<(), Error>
fn apply(&self, res: &Resources) -> Result<(), Error>
Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.
source§fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<(), Error>
fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<(), Error>
Attach a task to this controller by thread group id.