locktorture: Forgive apparent unfairness if CPU hotplug
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 31 Jan 2020 04:37:04 +0000 (20:37 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 20 Feb 2020 23:59:59 +0000 (15:59 -0800)
If CPU hotplug testing is enabled, a lock might appear to be maximally
unfair just because one of the CPUs was offline almost all the time.
This commit therefore forgives unfairness if CPU hotplug testing was
enabled.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/locking/locktorture.c

index 5baf904e8f39077c7b45f0cfb0512b97fe003d04..5efbfc68ce998a52c5f5e4588444d551ba798566 100644 (file)
@@ -704,7 +704,8 @@ static void __torture_print_stats(char *page,
        page += sprintf(page,
                        "%s:  Total: %lld  Max/Min: %ld/%ld %s  Fail: %d %s\n",
                        write ? "Writes" : "Reads ",
-                       sum, max, min, max / 2 > min ? "???" : "",
+                       sum, max, min,
+                       !onoff_interval && max / 2 > min ? "???" : "",
                        fail, fail ? "!!!" : "");
        if (fail)
                atomic_inc(&cxt.n_lock_torture_errors);