mbox

[0/3] Revert the use of sched_getaffinity on get_nproc

Message ID 20210906181133.1401140-1-adhemerval.zanella@linaro.org
Headers

Message

Adhemerval Zanella Sept. 6, 2021, 6:11 p.m. UTC
  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.

This patchset revert to previous strategy to obtain the system-wide
information first from sysfs, and then on procfs as a fallback.

The sched_getaffinity is still used on malloc code since it makes more
sense to get the per-process value to tune the maximum arena value.

Adhemerval Zanella (3):
  misc: Add __get_nprocs_sched
  linux: Simplify get_nprocs
  linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310)

 include/sys/sysinfo.h                 |   7 +-
 malloc/arena.c                        |   2 +-
 misc/getsysstats.c                    |   6 +
 posix/Makefile                        |   3 +-
 sysdeps/mach/getsysstats.c            |   6 +
 sysdeps/unix/sysv/linux/getsysstats.c | 192 ++++++++++++++++++++------
 6 files changed, 167 insertions(+), 49 deletions(-)