[PATCH RFC 09/29] f2fs: use a per-superblock fsverity workqueue

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

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

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

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

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index bbf1dad6843f..043e76b8efae 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4634,6 +4634,17 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
#endif
#ifdef CONFIG_FS_VERITY
sb->s_vop = &f2fs_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 free_bio_info;
#endif
sb->s_xattr = f2fs_xattr_handlers;
sb->s_export_op = &f2fs_export_ops;

--
2.50.0