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(point: PathBuf, root: PathBuf, v2: bool) -> Self
pub fn new(point: PathBuf, 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 Freeze for HugeTlbController
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.