]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
test-ww_mutex: Move work to its own UNBOUND workqueue
authorJohn Stultz <jstultz@google.com>
Fri, 5 Dec 2025 01:35:10 +0000 (01:35 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 18 Dec 2025 09:45:23 +0000 (10:45 +0100)
The test-ww_mutex test already allocates its own workqueue
so be sure to use it for the mtx.work and abba.work rather
then the default system workqueue.

This resolves numerous messages of the sort:
"workqueue: test_abba_work hogged CPU... consider switching to WQ_UNBOUND"
"workqueue: test_mutex_work hogged CPU... consider switching to WQ_UNBOUND"

Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251205013515.759030-3-jstultz@google.com
kernel/locking/test-ww_mutex.c

index d27aaaa860a36be5295f86555e6b064f74ebd14b..30512b3e95c99723aa17b969af12aabe37e0ff1c 100644 (file)
@@ -72,7 +72,7 @@ static int __test_mutex(struct ww_class *class, unsigned int flags)
        init_completion(&mtx.done);
        mtx.flags = flags;
 
-       schedule_work(&mtx.work);
+       queue_work(wq, &mtx.work);
 
        wait_for_completion(&mtx.ready);
        ww_mutex_lock(&mtx.mutex, (flags & TEST_MTX_CTX) ? &ctx : NULL);
@@ -234,7 +234,7 @@ static int test_abba(struct ww_class *class, bool trylock, bool resolve)
        abba.trylock = trylock;
        abba.resolve = resolve;
 
-       schedule_work(&abba.work);
+       queue_work(wq, &abba.work);
 
        ww_acquire_init_noinject(&ctx, class);
        if (!trylock)