public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Revert the use of sched_getaffinity on get_nproc
@ 2021-09-06 18:11 Adhemerval Zanella
  2021-09-06 18:11 ` [PATCH 1/3] misc: Add __get_nprocs_sched Adhemerval Zanella
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2021-09-06 18:11 UTC (permalink / raw)
  To: libc-alpha; +Cc: Nicolas Saenz Julienne, Florian Weimer

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(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-07 12:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 18:11 [PATCH 0/3] Revert the use of sched_getaffinity on get_nproc Adhemerval Zanella
2021-09-06 18:11 ` [PATCH 1/3] misc: Add __get_nprocs_sched Adhemerval Zanella
2021-09-06 18:11 ` [PATCH 2/3] linux: Simplify get_nprocs Adhemerval Zanella
2021-09-07  9:30   ` Florian Weimer
2021-09-07 12:05     ` Adhemerval Zanella
2021-09-07  9:44   ` Florian Weimer
2021-09-06 18:11 ` [PATCH 3/3] linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310) Adhemerval Zanella
2021-09-07  9:45   ` Florian Weimer
2021-09-07 12:12     ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).