[PATCH 15/19] fuse2fs: constrain worker thread count

Darrick J. Wong
2025-11-06T22:35:04Z

fuse2fs isn't all that scalable -- there's a big kernel lock around all
the libext2fs code. Constrain the fuse worker thread count to reduce
unnecessary lock contention.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
misc/fuse2fs.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index c1bd76ba449370..d890855df9c0f3 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -5259,6 +5259,14 @@ int main(int argc, char *argv[])
"-oallow_other,default_permissions,suid,dev");
}

+ /*
+ * Since there's a Big Kernel Lock around all the libext2fs code, we
+ * only need to start four threads -- one to decode a request, another
+ * to do the filesystem work, a third to transmit the reply, and a
+ * fourth to handle fuse notifications.
+ */
+ fuse_opt_insert_arg(&args, 1, "-omax_threads=4");
+
if (fctx.debug) {
int i;