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.
Unified · Split
| @@ -398,6 +398,7 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra · 397 unmodified lines | ||
| 398 | 398 | static int scftorture_invoker(void *arg) |
| 399 | 399 | { |
| 400 | 400 | int cpu; |
| 401 | + int curcpu; | |
| 401 | 402 | DEFINE_TORTURE_RANDOM(rand); |
| 402 | 403 | struct scf_statistics *scfp = (struct scf_statistics *)arg; |
| 403 | 404 | bool was_offline = false; |
| @@ -412,7 +413,10 @@ static int scftorture_invoker(void *arg) · 8 unmodified lines | ||
| 412 | 413 | VERBOSE_SCFTORTOUT("scftorture_invoker %d: Waiting for all SCF torturers from cpu %d", scfp->cpu, smp_processor_id()); |
| 413 | 414 | |
| 414 | 415 | // 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); | |
| 416 | 420 | |
| 417 | 421 | if (!atomic_dec_return(&n_started)) |
| 418 | 422 | while (atomic_read_acquire(&n_started)) { |