[PATCH 1/2] test-ww_mutex: Report whether stress failures are isolated or mixed
From: Håkon Bugge
Date: Wed Sep 02 2026 - 08:51:12 EST
The stress tests can run an individual stress worker type in isolation or
together with the other stress worker types.
Include this information in the error message so that failures can be
distinguished between isolated and mixed workloads.
Signed-off-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx>
---
kernel/locking/test-ww_mutex.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c
index e11f6b869b4d4..01af56b0bb6c0 100644
--- a/kernel/locking/test-ww_mutex.c
+++ b/kernel/locking/test-ww_mutex.c
@@ -408,6 +408,7 @@ struct stress {
unsigned long timeout;
int nlocks;
int result;
+ bool run_in_isolation;
};
struct rnd_state rng;
@@ -449,6 +450,11 @@ static void dummy_load(struct stress *stress)
usleep_range(1000, 2000);
}
+static const char *in_isolation_or_mixed(bool in_isolation)
+{
+ return in_isolation ? "in isolation" : "mixed workload";
+}
+
static void stress_inorder_work(struct work_struct *work)
{
struct stress *stress = container_of(work, typeof(*stress), work);
@@ -497,8 +503,8 @@ static void stress_inorder_work(struct work_struct *work)
ww_acquire_fini(&ctx);
if (err) {
- pr_err_once("stress (%s) failed with %d\n",
- __func__, err);
+ pr_err_once("stress (%s; %s) failed with %d\n",
+ __func__, in_isolation_or_mixed(stress->run_in_isolation), err);
break;
}
} while (!time_after(jiffies, stress->timeout));
@@ -551,8 +557,9 @@ static void stress_reorder_work(struct work_struct *work)
ww_mutex_unlock(ln->lock);
if (err != -EDEADLK) {
- pr_err_once("stress (%s) failed with %d\n",
- __func__, err);
+ pr_err_once("stress (%s; %s) failed with %d\n",
+ __func__,
+ in_isolation_or_mixed(stress->run_in_isolation), err);
break;
}
@@ -588,8 +595,8 @@ static void stress_one_work(struct work_struct *work)
dummy_load(stress);
ww_mutex_unlock(lock);
} else {
- pr_err_once("stress (%s) failed with %d\n",
- __func__, err);
+ pr_err_once("stress (%s; %s) failed with %d\n",
+ __func__, in_isolation_or_mixed(stress->run_in_isolation), err);
break;
}
} while (!time_after(jiffies, stress->timeout));
@@ -653,6 +660,7 @@ static int stress(struct ww_class *class, int nlocks, int nthreads, unsigned int
stress->locks = locks;
stress->nlocks = nlocks;
stress->timeout = jiffies + 2*HZ;
+ stress->run_in_isolation = flags != STRESS_ALL;
queue_work(wq, &stress->work);
nthreads--;
--
2.43.5