google / google/benchmark

[BUG] ARM big.LITTLE boards report wrong cpu count and frequency

Open
#1,385 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

**Describe the bug**
On big.LITTLE ARM systems the displayed frequency and corresponding cpu count are wrong.

**System**
Which OS, compiler, and compiler version are you using:
- OS: Debian
- Compiler and version: clang-12

**To reproduce**
Link a binary against libbenchmark and run it
Example output:
```
Running ./dojo_bench
Run on (6 X 1512 MHz CPU s)
Load Average: 0.10, 0.19, 0.77
```

**Expected behavior**
Print the highest cpu frequency of all available cores, because the benchmark is always ran there.
```
Running ./dojo_bench
Run on (2 X 2016 MHz CPU s and 4 X 1512 MHz CPU s)
Load Average: 0.10, 0.19, 0.77
```

**Additional context**
```
for i in {0..5}; do cat /sys/devices/system/cpu/cpu"$i"/cpufreq/scaling_max_freq; done
1512000
1512000
1512000
1512000
2016000
2016000
```
The benchmark is always ran either on cpu 4 or 5. Shutting down last 2 cores causes benchmark times to drop significantly, proving that the "1512 MHz" core is never used.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.