[PATCH RFC 08/29] ext4: use a per-superblock fsverity workqueue

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

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

Switch ext4 to use a per-sb fsverity workqueue instead of a systemwide
workqueue.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
fs/ext4/super.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c7d39da7e733..dcb9d1933c2e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5373,6 +5373,17 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
#endif
#ifdef CONFIG_FS_VERITY
sb->s_vop = &ext4_verityops;
+ /*
+ * 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.
+ */
+ err = fsverity_init_wq(sb, WQ_HIGHPRI, num_online_cpus());
+ if (err)
+ goto failed_mount3a;
#endif
#ifdef CONFIG_QUOTA
sb->dq_op = &ext4_quota_operations;

--
2.50.0