Skip to content

Commit f3ea978

Browse files
committed
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>
1 parent 0050453 commit f3ea978

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/scftorture.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra
398398
static int scftorture_invoker(void *arg)
399399
{
400400
int cpu;
401+
int curcpu;
401402
DEFINE_TORTURE_RANDOM(rand);
402403
struct scf_statistics *scfp = (struct scf_statistics *)arg;
403404
bool was_offline = false;
@@ -412,7 +413,10 @@ static int scftorture_invoker(void *arg)
412413
VERBOSE_SCFTORTOUT("scftorture_invoker %d: Waiting for all SCF torturers from cpu %d", scfp->cpu, smp_processor_id());
413414

414415
// Make sure that the CPU is affinitized appropriately during testing.
415-
WARN_ON_ONCE(smp_processor_id() != scfp->cpu);
416+
curcpu = smp_processor_id();
417+
WARN_ONCE(curcpu != scfp->cpu % nr_cpu_ids,
418+
"%s: Wanted CPU %d, running on %d, nr_cpu_ids = %d\n",
419+
__func__, scfp->cpu, curcpu, nr_cpu_ids);
416420

417421
if (!atomic_dec_return(&n_started))
418422
while (atomic_read_acquire(&n_started)) {

0 commit comments

Comments
 (0)