From: Breno Leitao <leitao@debian.org>
To: Andrew Morton <akpm@linux-foundation.org>, Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
Breno Leitao <leitao@debian.org>
Subject: [PATCH] workqueue: forbid TEST_WORKQUEUE from being built-in
Date: Mon, 11 May 2026 05:26:55 -0700 [thread overview]
Message-ID: <20260511-workqueue_fix_test-v1-1-ef460d0e6ea8@debian.org> (raw)
The benchmark drives the workqueue's affinity_scope through sysfs by
filp_open()'ing /sys/bus/workqueue/devices/bench_wq/affinity_scope. When
CONFIG_TEST_WORKQUEUE=y, the module_init runs during kernel init before
userspace has mounted sysfs, so every open returns -ENOENT and the
benchmark loop spins emitting:
test_workqueue: open /sys/bus/workqueue/devices/bench_wq/affinity_scope failed: -2
Mirror the TEST_BPF pattern and add "depends on m" so Kconfig will not
let this be built into the kernel image, and document the reason in the
help text.
Fixes: 24b2e73f9700 ("workqueue: add test_workqueue benchmark module")
Signed-off-by: Breno Leitao <leitao@debian.org>
---
lib/Kconfig.debug | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 9d54c48d7d982..9dfe6e16de91b 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2666,12 +2666,17 @@ config TEST_VMALLOC
config TEST_WORKQUEUE
tristate "Test module for stress/performance analysis of workqueue"
+ depends on m
default n
help
This builds the "test_workqueue" module for benchmarking
workqueue throughput under contention. Useful for evaluating
affinity scope changes (e.g., cache_shard vs cache).
+ The test drives sysfs to switch affinity scopes, so it must be
+ loaded after userspace has mounted sysfs; building it in (=y)
+ would run module_init before /sys is available.
+
If unsure, say N.
config TEST_BPF
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260511-workqueue_fix_test-eb1134cb7237
Best regards,
--
Breno Leitao <leitao@debian.org>
next reply other threads:[~2026-05-11 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 12:26 Breno Leitao [this message]
2026-05-11 19:04 ` [PATCH] workqueue: forbid TEST_WORKQUEUE from being built-in Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260511-workqueue_fix_test-v1-1-ef460d0e6ea8@debian.org \
--to=leitao@debian.org \
--cc=akpm@linux-foundation.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox