Re: [PATCH v3 1/2] squashfs: add the mount parameter theads=<single|multi|percpu>

From: Phillip Lougher
Date: Fri Sep 09 2022 - 11:50:22 EST


On 02/09/2022 10:48, Xiaoming Ni wrote:
Squashfs supports three decompression concurrency modes:
Single-thread mode: concurrent reads are blocked and the memory overhead
is small.
Multi-thread mode/percpu mode: reduces concurrent read blocking but
increases memory overhead.

The corresponding schema must be fixed at compile time. During mounting,
the concurrent decompression mode cannot be adjusted based on file read
blocking.

The mount parameter theads=<single|multi|percpu> is added to select
the concurrent decompression mode of a single SquashFS file system
image.

Signed-off-by: Xiaoming Ni <nixiaoming@xxxxxxxxxx>

Additional review comment ...

[SNIP]

diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 32565dafa7f3..fd4e70d45f3c 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -47,10 +47,12 @@ enum Opt_errors {

[SNIP]

+#ifdef CONFIG_SQUASHFS_DECOMP_SINGLE
+ opts->thread_ops = &squashfs_decompressor_single; > +#elif CONFIG_SQUASHFS_DECOMP_MULTI

this should be

#elif defined CONFIG_SQUASHFS_DECOMP_MULTI

+ opts->thread_ops = &squashfs_decompressor_multi;
+#elif CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU

this should be

#elif defined CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU

Phillip

+ opts->thread_ops = &squashfs_decompressor_percpu;
+#endif
fc->fs_private = opts;
fc->ops = &squashfs_context_ops;
return 0;