workqueue: forbid TEST_WORKQUEUE from being built-in
PATCH 1/1 workqueue: forbid TEST_WORKQUEUE from being built-in
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.
--- lib/Kconfig.debug | 5 +++++ 1 file changed, 5 insertions(+)
lib/Kconfig.debug +5 -0
@@ -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,
Signature · 1 line
Breno Leitao <[email protected]>
Tejun Heo
AppliedHello,
Applied to wq/for-7.2.
Thanks.
--
tejun