diff --git a/cgroups/src/v2/memory.rs b/cgroups/src/v2/memory.rs index 77d65b32d..b2fb728f4 100644 --- a/cgroups/src/v2/memory.rs +++ b/cgroups/src/v2/memory.rs @@ -100,7 +100,6 @@ impl Memory { // -1 means max if swap == -1 || limit == -1 { Memory::set(path.join(CGROUP_MEMORY_SWAP), swap)?; - Memory::set(path.join(CGROUP_MEMORY_MAX), limit)?; } else { if swap < limit { bail!( @@ -114,9 +113,9 @@ impl Memory { // a separate value, so the swap value in the runtime spec needs // to be converted from the cgroup v1 value to the cgroup v2 value // by subtracting limit from swap - Memory::set(path.join(CGROUP_MEMORY_SWAP), swap - limit)?; - Memory::set(path.join(CGROUP_MEMORY_MAX), limit)?; + Memory::set(path.join(CGROUP_MEMORY_SWAP), swap - limit)?; } + Memory::set(path.join(CGROUP_MEMORY_MAX), limit)?; } None => { if limit == -1 { diff --git a/src/commands/info.rs b/src/commands/info.rs index 0abd89dc3..e7b2083de 100644 --- a/src/commands/info.rs +++ b/src/commands/info.rs @@ -148,7 +148,7 @@ pub fn print_cgroups() { } if let Some(config) = read_kernel_config() { - let display = FeatureDisplay::with_status("device", "attached", "detached"); + let display = FeatureDisplay::with_status("devices", "attached", "detached"); print_feature_status(&config, "CONFIG_CGROUP_BPF", display); } }