aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2025-01-10 12:55:50 -0500
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2025-01-14 09:23:36 -0500
commit09ea1afec75ed0d41cb0da27a9df1b8c3dd56ddc (patch)
treee42d71d0038e1417211f7d497f0a69b8316c45c4 /sysdeps
parent2ac7701888c9918fcdd8b35adcbcd91d7e1e923f (diff)
downloadglibc-09ea1afec75ed0d41cb0da27a9df1b8c3dd56ddc.zip
glibc-09ea1afec75ed0d41cb0da27a9df1b8c3dd56ddc.tar.gz
glibc-09ea1afec75ed0d41cb0da27a9df1b8c3dd56ddc.tar.bz2
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>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/tst-sched-affinity-inheritance.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-sched-affinity-inheritance.c b/sysdeps/unix/sysv/linux/tst-sched-affinity-inheritance.c
index fe0297f..8a42d27 100644
--- a/sysdeps/unix/sysv/linux/tst-sched-affinity-inheritance.c
+++ b/sysdeps/unix/sysv/linux/tst-sched-affinity-inheritance.c
@@ -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");