-
Notifications
You must be signed in to change notification settings - Fork 0
add v2 support #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base
Are you sure you want to change the base?
Conversation
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Add SPDX-License-Identifier for all existing codes. Fixes: levex#2 Signed-off-by: bin liu <[email protected]>
add SPDX-License-Identifier for all source
Signed-off-by: bin liu <[email protected]>
src/blkio.rs
Outdated
let mut content = format!("{}:{} {}", major, minor, iops); | ||
if self.v2 { | ||
file = "io.max"; | ||
content = format!("{}:{} riops={}", major, minor, iops); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是 wriops
let mut file = "blkio.weight_device"; | ||
if self.v2 { | ||
// FIXME why is there no weight for device in runc ? | ||
// https://github.com/opencontainers/runc/blob/46be7b612e2533c494e6a251111de46d8e286ed5/libcontainer/cgroups/fs2/io.go#L30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像跟 io 调度算法有关 。https://wiki.ubuntu.com/Kernel/Reference/IOSchedulers
tests/devices.rs
Outdated
|
||
#[test] | ||
fn test_devices_parsing() { | ||
let hier = cgroups::hierarchies::V1::new(); | ||
let cg = Cgroup::new(&hier, String::from("test_devices_parsing")); | ||
// no only v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no -> now
tests/hugetlb.rs
Outdated
|
||
#[test] | ||
fn test_hugetlb_sizes() { | ||
// no only v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no -> now
src/blkio.rs
Outdated
fn apply(&self, res: &Resources) -> Result<()> { | ||
// get the resources that apply to this controller | ||
let res: &BlkIoResources = &res.blkio; | ||
|
||
if res.update_values { | ||
let _ = self.set_weight(res.weight as u64); | ||
let _ = self.set_leaf_weight(res.leaf_weight as u64); | ||
if res.weight.is_some() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方的几个 判断 is_some 的句式 改成下面的样子吧:
if let Some(weight) = res.weight {
let _ = self.set_weight(weight as u64);
}
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
Signed-off-by: bin liu <[email protected]>
add cgroup v2 support
cfs_quota can be set to -1 to indicate no limit Fixes: levex#5 Signed-off-by: bin liu <[email protected]>
Errors cause should be shared to let anyhow to wrap it. Fixes: levex#7 Signed-off-by: bin liu <[email protected]>
cpu: change cfs_quota from u64 to i64
…-cause errors: add sync marker to error cause
c_char is equal to i8 on x86, but it is equal to u8 on arm arch, so we need to use type c_char instead of i8 to avoid compiling error. Fixes: levex#9 Signed-off-by: zhanghj <[email protected]>
…-aarch64 lib: fix compiling error for type i8 in aarch64 environment
Fixes: levex#11 Signed-off-by: bin liu <[email protected]>
update Travis configs
No description provided.