]> git.ipfire.org Git - thirdparty/glibc.git/commit
malloc: Use __get_nprocs on arena_get2 (BZ 30945)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 11 Oct 2023 16:43:56 +0000 (13:43 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 12 Feb 2024 13:20:44 +0000 (10:20 -0300)
commit3fcb410465b2d299fbc1939685182192705e5667
tree11aec4686435d5bd9c0a1039bff43dfca87f77ef
parent62ac4b09c4ee66c91478212359b8ac44b4f6a9e2
malloc: Use __get_nprocs on arena_get2 (BZ 30945)

This restore the 2.33 semantic for arena_get2.  It was changed by
11a02b035b46 to avoid arena_get2 call malloc (back when __get_nproc
was refactored to use an scratch_buffer - 903bc7dcc2acafc).  The
__get_nproc was refactored over then and now it also avoid to call
malloc.

The 11a02b035b46 did not take in consideration any performance
implication, which should have been discussed properly.  The
__get_nprocs_sched is still used as a fallback mechanism if procfs
and sysfs is not acessible.

Checked on x86_64-linux-gnu.
Reviewed-by: DJ Delorie <dj@redhat.com>
(cherry picked from commit 472894d2cfee5751b44c0aaa71ed87df81c8e62e)
include/sys/sysinfo.h
malloc/arena.c
misc/getsysstats.c
sysdeps/mach/getsysstats.c
sysdeps/unix/sysv/linux/getsysstats.c