Skip to content

Commit 694d1c5

Browse files
authored
Adjust cgroup cpu max to use num_cpu::get (#1304)
### What does this PR do? This change has been previously made on the procfs side of the observer. We now match the cgroup reader.
1 parent eab22b4 commit 694d1c5

File tree

1 file changed

+2
-2
lines changed
  • lading/src/observer/linux/cgroup/v2

1 file changed

+2
-2
lines changed

lading/src/observer/linux/cgroup/v2/cpu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ impl Sampler {
5252
let (max_str, period_str) = (parts[0], parts[1]);
5353
let allowed_cores = if max_str == "max" {
5454
// If the target cgroup has no CPU limit we assume it has access to all
55-
// physical cores.
56-
num_cpus::get_physical() as f64
55+
// logical cores, inclusive of hyperthreaded cores.
56+
num_cpus::get() as f64
5757
} else {
5858
let max_val = max_str.parse::<f64>()?;
5959
let period_val = period_str.parse::<f64>()?;

0 commit comments

Comments
 (0)