pub struct CgroupRoot { /* private fields */ }Expand description
CgroupRoot is the root of the cgroup hierarchy. The root cgroup is different from the rest of
the cgroups in a cgroup hierarchy (sub-cgroups of the root) in a few ways:
-
The root contains all known processes on cgroup creation, and all new processes as they are spawned. As such, the root cgroup reports processes belonging to it differently than its sub-cgroups.
-
The root does not contain resource controller interface files, as otherwise they would apply to the whole system.
-
The root does not own a
FsNodeas it is created and owned by theFileSysteminstead.
Implementations§
Source§impl CgroupRoot
impl CgroupRoot
pub fn new() -> Arc<CgroupRoot>
pub fn get_cgroup<TG: Copy + Into<ThreadGroupKey>>( &self, tg: TG, ) -> Option<Weak<Cgroup>>
Trait Implementations§
Source§impl CgroupOps for CgroupRoot
impl CgroupOps for CgroupRoot
Source§fn add_process(
&self,
locked: &mut Locked<FileOpsCore>,
thread_group: &ThreadGroup,
) -> Result<(), Errno>
fn add_process( &self, locked: &mut Locked<FileOpsCore>, thread_group: &ThreadGroup, ) -> Result<(), Errno>
Add a process to a cgroup. Errors if the cgroup has been deleted.
Source§fn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Create a new sub-cgroup as a child of this cgroup. Errors if the cgroup is deleted, or a
child with
name already exists.Source§fn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Gets the child with
name, errors if not found.Source§fn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Remove a child from this cgroup and return it, if found. Errors if cgroup is deleted, or a
child with
name is not found.Source§fn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>
fn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>
Gets all children of this cgroup.
Source§fn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ
fn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ
Return all pids that belong to this cgroup.
Source§fn is_populated(&self) -> bool
fn is_populated(&self) -> bool
Whether the cgroup or any of its descendants have any processes.
Source§fn get_freezer_state(&self) -> CgroupFreezerState
fn get_freezer_state(&self) -> CgroupFreezerState
Get the freezer
self state and effective state.Source§fn freeze(&self, _locked: &mut Locked<FileOpsCore>)
fn freeze(&self, _locked: &mut Locked<FileOpsCore>)
Freeze all tasks in the cgroup.
Auto Trait Implementations§
impl !Freeze for CgroupRoot
impl !RefUnwindSafe for CgroupRoot
impl Send for CgroupRoot
impl Sync for CgroupRoot
impl Unpin for CgroupRoot
impl !UnwindSafe for CgroupRoot
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
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.