summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-07-03 15:23:19 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-08-24 18:38:37 -0700
commit9e66bf03f9c538863e614a72c5799bcd9579630e (patch)
tree686d919073ce1d49131a5ff2631da4c06056171a
parenta7c072ef26644b632241d549869f10f8d2dd3b5c (diff)
scftorture: Adapt memory-ordering test to UP operation
On uniprocessor systems, smp_call_function() does nothing. This commit therefore avoids complaining about the lack of handler accesses in the single-CPU case where there is no handler. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rw-r--r--kernel/scftorture.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index 04d3a4279413..fc22bcc9a589 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -363,7 +363,8 @@ static void scftorture_invoke_one(struct scf_statistics *scfp, struct torture_ra
scfcp->scfc_out = true;
}
if (scfcp && scfsp->scfs_wait) {
- if (WARN_ON_ONCE(!scfcp->scfc_out))
+ if (WARN_ON_ONCE((num_online_cpus() > 1 || scfsp->scfs_prim == SCF_PRIM_SINGLE) &&
+ !scfcp->scfc_out))
atomic_inc(&n_mb_out_errs); // Leak rather than trash!
else
kfree(scfcp);