mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Support customized attributes for CpuController and MemController
Customized attributes are useful for customized kernels.
Usage:
let resource = &mut cgroups::Resources::default();
resource.cpu.attrs.insert("cpu.cfs_init_buffer_us", "10".to_string());
// apply here
Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
@@ -21,8 +21,8 @@ use crate::events;
|
||||
use crate::flat_keyed_to_hashmap;
|
||||
|
||||
use crate::{
|
||||
ControllIdentifier, ControllerInternal, Controllers, MaxValue, MemoryResources, Resources,
|
||||
Subsystem,
|
||||
ControllIdentifier, ControllerInternal, Controllers, CustomizedAttribute, MaxValue,
|
||||
MemoryResources, Resources, Subsystem,
|
||||
};
|
||||
|
||||
/// A controller that allows controlling the `memory` subsystem of a Cgroup.
|
||||
@@ -834,6 +834,8 @@ impl ControllIdentifier for MemController {
|
||||
}
|
||||
}
|
||||
|
||||
impl CustomizedAttribute for MemController {}
|
||||
|
||||
impl<'a> From<&'a Subsystem> for &'a MemController {
|
||||
fn from(sub: &'a Subsystem) -> &'a MemController {
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user