diff options
author | Xiaoming Ni <nixiaoming@huawei.com> | 2022-10-19 11:09:30 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2022-11-18 13:55:08 -0800 |
commit | fb40fe04f9df23114782d5edd1c5d017ae9d0ca8 (patch) | |
tree | 8bd72fc85c666ab240e6166258e0caf4bc701a63 /fs/squashfs/decompressor_multi.c | |
parent | 80f784098ff44e086f68f0e8c98b6c6da8702ec4 (diff) | |
download | linux-stable-fb40fe04f9df23114782d5edd1c5d017ae9d0ca8.tar.gz linux-stable-fb40fe04f9df23114782d5edd1c5d017ae9d0ca8.tar.bz2 linux-stable-fb40fe04f9df23114782d5edd1c5d017ae9d0ca8.zip |
squashfs: allows users to configure the number of decompression threads
The maximum number of threads in the decompressor_multi.c file is fixed
and cannot be adjusted according to user needs. Therefore, the mount
parameter needs to be added to allow users to configure the number of
threads as required. The upper limit is num_online_cpus() * 2.
Link: https://lkml.kernel.org/r/20221019030930.130456-3-nixiaoming@huawei.com
Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk>
Cc: Jianguo Chen <chenjianguo3@huawei.com>
Cc: Jubin Zhong <zhongjubin@huawei.com>
Cc: Zhang Yi <yi.zhang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/squashfs/decompressor_multi.c')
-rw-r--r-- | fs/squashfs/decompressor_multi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/squashfs/decompressor_multi.c b/fs/squashfs/decompressor_multi.c index eb25432bd149..416c53eedbd1 100644 --- a/fs/squashfs/decompressor_multi.c +++ b/fs/squashfs/decompressor_multi.c @@ -144,7 +144,7 @@ static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk, * If there is no available decomp and already full, * let's wait for releasing decomp from other users. */ - if (stream->avail_decomp >= MAX_DECOMPRESSOR) + if (stream->avail_decomp >= msblk->max_thread_num) goto wait; /* Let's allocate new decomp */ @@ -160,7 +160,7 @@ static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk, } stream->avail_decomp++; - WARN_ON(stream->avail_decomp > MAX_DECOMPRESSOR); + WARN_ON(stream->avail_decomp > msblk->max_thread_num); mutex_unlock(&stream->mutex); break; |