From 09ea1afec75ed0d41cb0da27a9df1b8c3dd56ddc Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Fri, 10 Jan 2025 12:55:50 -0500 Subject: 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 Co-authored-by: Siddhesh Poyarekar --- sysdeps/unix/sysv/linux/tst-sched-affinity-inheritance.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sysdeps/unix/sysv/linux') 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"); -- cgit v1.1