Commit ae8c90e
committed
deps: prefer cpuinfo_cur_freq over scaling_cur_freq in uv_cpu_info()
On Linux, uv_cpu_info() reads the current CPU frequency for each core
from /sys/devices/system/cpu/cpuN/cpufreq/scaling_cur_freq. On some
modern AMD CPUs (EPYC, Ryzen 9000 series) running inside containers,
reading scaling_cur_freq triggers an ACPI/SMM round-trip that can take
~20ms per core, making os.cpus() take 500-600ms on a 32-core system.
The file cpuinfo_cur_freq exposes the same current frequency information
but reads from a hardware-cached register, avoiding the costly ACPI
round-trip. Prefer it when available and fall back to scaling_cur_freq
for systems that do not expose cpuinfo_cur_freq.
Fixes: #619981 parent 9145cc6 commit ae8c90e
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
1889 | 1894 | | |
1890 | | - | |
1891 | | - | |
| 1895 | + | |
1892 | 1896 | | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
1893 | 1902 | | |
1894 | 1903 | | |
1895 | 1904 | | |
| |||
0 commit comments