Skip to content
Commit 04cf65b7 authored by Harish's avatar Harish Committed by Greg Kroah-Hartman
Browse files

selftests/powerpc: Fix CPU affinity for child process

[ Upstream commit 854eb502 ]

On systems with large number of cpus, test fails trying to set
affinity by calling sched_setaffinity() with smaller size for affinity
mask. This patch fixes it by making sure that the size of allocated
affinity mask is dependent on the number of CPUs as reported by
get_nprocs().

Fixes: 00b7ec5c

 ("selftests/powerpc: Import Anton's context_switch2 benchmark")
Reported-by: default avatarShirisha Ganta <shiganta@in.ibm.com>
Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
Signed-off-by: default avatarHarish <harish@linux.ibm.com>
Reviewed-by: default avatarKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Reviewed-by: default avatarSatheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200609081423.529664-1-harish@linux.ibm.com
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3e95f258
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment