diff options
| author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-09-06 14:19:51 -0300 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-10-01 18:19:45 +0200 |
| commit | 822662cf2a4b170ade4c5342f035d68815a03276 (patch) | |
| tree | 4d250097995199bb2a1216bf67a2739093a21029 /scripts/cpp | |
| parent | cda99af14e82b4bb6abaecd717ebe3b57c0aa534 (diff) | |
| download | glibc-822662cf2a4b170ade4c5342f035d68815a03276.tar.xz glibc-822662cf2a4b170ade4c5342f035d68815a03276.zip | |
linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310)
The use of sched_getaffinity on get_nproc and
sysconf (_SC_NPROCESSORS_ONLN) done in 903bc7dcc2acafc40 (BZ #27645)
breaks the top command in common hypervisor configurations and also
other monitoring tools.
The main issue using sched_getaffinity changed the symbols semantic
from system-wide scope of online CPUs to per-process one (which can
be changed with kernel cpusets or book parameters in VM).
This patch reverts mostly of the 903bc7dcc2acafc40, with the
exceptions:
* No more cached values and atomic updates, since they are inherent
racy.
* No /proc/cpuinfo fallback, since /proc/stat is already used and
it would require to revert more arch-specific code.
* The alloca is replace with a static buffer of 1024 bytes.
So the implementation first consult the sysfs, and fallbacks to procfs.
Checked on x86_64-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 342298278eabc75baabcaced110a11a02c3d3580)
Diffstat (limited to 'scripts/cpp')
0 files changed, 0 insertions, 0 deletions
