diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2022-02-05 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2022-02-07 20:18:29 +0000 |
commit | e1d32b836410767270a3adf1f82b1a47e6e4cd51 (patch) | |
tree | 25c2462f83936cba66bec85fb38a398eed5a003b /benchtests | |
parent | 1b0c60f95bbe2eded80b2bb5be75c0e45b11cde1 (diff) | |
download | glibc-e1d32b836410767270a3adf1f82b1a47e6e4cd51.tar.gz glibc-e1d32b836410767270a3adf1f82b1a47e6e4cd51.tar.xz glibc-e1d32b836410767270a3adf1f82b1a47e6e4cd51.zip |
linux: fix accuracy of get_nprocs and get_nprocs_conf [BZ #28865]
get_nprocs() and get_nprocs_conf() use various methods to obtain an accurate number of processors. Re-introduce __get_nprocs_sched() as a source of information, and fix the order in which these methods are used to return the most accurate information. The primary source of information used in both functions remains unchanged. This also changes __get_nprocs_sched() error return value from 2 to 0, but all its users are already prepared to handle that. Old fallback order: get_nprocs: /sys/devices/system/cpu/online -> /proc/stat -> 2 get_nprocs_conf: /sys/devices/system/cpu/ -> /proc/stat -> 2 New fallback order: get_nprocs: /sys/devices/system/cpu/online -> /proc/stat -> sched_getaffinity -> 2 get_nprocs_conf: /sys/devices/system/cpu/ -> /proc/stat -> sched_getaffinity -> 2 Fixes: 342298278e ("linux: Revert the use of sched_getaffinity on get_nproc") Closes: BZ #28865 Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'benchtests')
0 files changed, 0 insertions, 0 deletions