[PATCH RFC 11/29] fsverity: remove system-wide workqueue

Andrey Albershteyn
2025-07-28T20:31:35Z

From: "Darrick J. Wong" <djwong@kernel.org>

Now that we've made the verity workqueue per-superblock, we don't need
the systemwide workqueue. Get rid of the old implementation.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
fs/verity/fsverity_private.h | 2 --
fs/verity/init.c | 1 -
fs/verity/verify.c | 21 +--------------------
3 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h
index 04dd471d791c..2de28be775ea 100644
--- a/fs/verity/fsverity_private.h
+++ b/fs/verity/fsverity_private.h
@@ -152,8 +152,6 @@ static inline void fsverity_init_signature(void)

/* verify.c */

-void __init fsverity_init_workqueue(void);
-
#include <trace/events/fsverity.h>

#endif /* _FSVERITY_PRIVATE_H */
diff --git a/fs/verity/init.c b/fs/verity/init.c
index d65206608583..b252493496df 100644
--- a/fs/verity/init.c
+++ b/fs/verity/init.c
@@ -61,7 +61,6 @@ static int __init fsverity_init(void)
{
fsverity_check_hash_algs();
fsverity_init_info_cache();
- fsverity_init_workqueue();
fsverity_init_sysctl();
fsverity_init_signature();
fsverity_init_bpf();
diff --git a/fs/verity/verify.c b/fs/verity/verify.c
index ef5d27039c98..0edbf514dd31 100644
--- a/fs/verity/verify.c
+++ b/fs/verity/verify.c
@@ -10,8 +10,6 @@
#include <crypto/hash.h>
#include <linux/bio.h>

-static struct workqueue_struct *fsverity_read_workqueue;
-
/*
* Returns true if the hash block with index @hblock_idx in the tree, located in
* @hpage, has already been verified.
@@ -371,23 +369,6 @@ EXPORT_SYMBOL_GPL(fsverity_init_wq);
void fsverity_enqueue_verify_work(struct super_block *sb,
struct work_struct *work)
{
- queue_work(sb->s_verity_wq ?: fsverity_read_workqueue, work);
+ queue_work(sb->s_verity_wq, work);
}
EXPORT_SYMBOL_GPL(fsverity_enqueue_verify_work);
-
-void __init fsverity_init_workqueue(void)
-{
- /*
- * Use a high-priority workqueue to prioritize verification work, which
- * blocks reads from completing, over regular application tasks.
- *
- * For performance reasons, don't use an unbound workqueue. Using an
- * unbound workqueue for crypto operations causes excessive scheduler
- * latency on ARM64.
- */
- fsverity_read_workqueue = alloc_workqueue("fsverity_read_queue",
- WQ_HIGHPRI,
- num_online_cpus());
- if (!fsverity_read_workqueue)
- panic("failed to allocate fsverity_read_queue");
-}

--
2.50.0