summaryrefslogtreecommitdiffstats
path: root/kernel/scftorture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-11-11 10:12:05 -0800
committerPaul E. McKenney <paulmck@kernel.org>2021-01-04 13:53:41 -0800
commitf3ea978b712f768a02137e867aced5bfdcea670e (patch)
tree1868863884a3c2b7180ff07481f2e25c2e02a118 /kernel/scftorture.c
parent00504537f44422a99d97f615f2b3ee17cfba194d (diff)
downloadlinux-f3ea978b712f768a02137e867aced5bfdcea670e.tar.bz2
scftorture: Add debug output for wrong-CPU warning
This commit adds the desired CPU, the actual CPU, and nr_cpu_ids to the wrong-CPU warning in scftorture_invoker(), the better to help with debugging. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/scftorture.c')
-rw-r--r--kernel/scftorture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index d55a9f8cda3d..2377cbb32474 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -398,6 +398,7 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra
static int scftorture_invoker(void *arg)
{
int cpu;
+ int curcpu;
DEFINE_TORTURE_RANDOM(rand);
struct scf_statistics *scfp = (struct scf_statistics *)arg;
bool was_offline = false;
@@ -412,7 +413,10 @@ static int scftorture_invoker(void *arg)
VERBOSE_SCFTORTOUT("scftorture_invoker %d: Waiting for all SCF torturers from cpu %d", scfp->cpu, smp_processor_id());
// Make sure that the CPU is affinitized appropriately during testing.
- WARN_ON_ONCE(smp_processor_id() != scfp->cpu);
+ curcpu = smp_processor_id();
+ WARN_ONCE(curcpu != scfp->cpu % nr_cpu_ids,
+ "%s: Wanted CPU %d, running on %d, nr_cpu_ids = %d\n",
+ __func__, scfp->cpu, curcpu, nr_cpu_ids);
if (!atomic_dec_return(&n_started))
while (atomic_read_acquire(&n_started)) {