1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

affinity-inheritance: Overallocate CPU sets

Some kernels on S390 appear to return a CPU affinity mask based on
configured processors rather than the ones online.  Overallocate the CPU
set to match that, but operate only on the ones online.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Co-authored-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Stefan Liebler
2025-01-10 12:55:50 -05:00
committed by Siddhesh Poyarekar
parent 2ac7701888
commit 09ea1afec7
3 changed files with 19 additions and 10 deletions

View File

@ -34,10 +34,11 @@ set_my_affinity (size_t size, const cpu_set_t *set)
}
static void
verify_my_affinity (int nproc, size_t size, const cpu_set_t *expected_set)
verify_my_affinity (int nproc, int nproc_configured, size_t size,
const cpu_set_t *expected_set)
{
cpu_set_t *set = CPU_ALLOC (nproc);
cpu_set_t *xor_set = CPU_ALLOC (nproc);
cpu_set_t *set = CPU_ALLOC (nproc_configured);
cpu_set_t *xor_set = CPU_ALLOC (nproc_configured);
if (set == NULL || xor_set== NULL)
FAIL_EXIT1 ("verify_my_affinity: Failed to allocate cpuset: %m\n");