]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc: Fix CPU affinity for child process
authorHarish <harish@linux.ibm.com>
Tue, 9 Jun 2020 08:14:23 +0000 (13:44 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jul 2020 12:30:34 +0000 (22:30 +1000)
commitd24d4f85fb696cae664d7e50e1101cb6e263bd29
treeabdfe6dce75cf9fb0818cf64bf2a030f290364d9
parentb9d2c23bad3a2c05f26162faea90ac76ecaeab39
selftests/powerpc: Fix CPU affinity for child process

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: 824082491a43 ("selftests/powerpc: Import Anton's context_switch2 benchmark")
Reported-by: Shirisha Ganta <shiganta@in.ibm.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Harish <harish@linux.ibm.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Reviewed-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200609081423.529664-1-harish@linux.ibm.com
tools/testing/selftests/powerpc/benchmarks/context_switch.c