]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
workqueue: forbid TEST_WORKQUEUE from being built-in
authorBreno Leitao <leitao@debian.org>
Mon, 11 May 2026 12:26:55 +0000 (05:26 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 11 May 2026 18:58:23 +0000 (08:58 -1000)
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
lib/Kconfig.debug

index 8ff5adcfe1e0a2f13893c92c3b95498fedb83855..040f4e077435b5f3a329f0c4be3215f59760628d 100644 (file)
@@ -2649,12 +2649,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