267 lines · plain
1# SPDX-License-Identifier: GPL-2.0-only2config SQUASHFS3 tristate "SquashFS 4.0 - Squashed file system support"4 depends on BLOCK5 help6 Saying Y here includes support for SquashFS 4.0 (a Compressed7 Read-Only File System). Squashfs is a highly compressed read-only8 filesystem for Linux. It uses zlib, lzo or xz compression to9 compress both files, inodes and directories. Inodes in the system10 are very small and all blocks are packed to minimise data overhead.11 Block sizes greater than 4K are supported up to a maximum of 1 Mbytes12 (default block size 128K). SquashFS 4.0 supports 64 bit filesystems13 and files (larger than 4GB), full uid/gid information, hard links and14 timestamps.15 16 Squashfs is intended for general read-only filesystem use, for17 archival use (i.e. in cases where a .tar.gz file may be used), and in18 embedded systems where low overhead is needed. Further information19 and tools are available from http://squashfs.sourceforge.net.20 21 If you want to compile this as a module ( = code which can be22 inserted in and removed from the running kernel whenever you want),23 say M here. The module will be called squashfs. Note that the root24 file system (the one containing the directory /) cannot be compiled25 as a module.26 27 If unsure, say N.28 29choice30 prompt "File decompression options"31 depends on SQUASHFS32 help33 Squashfs now supports two options for decompressing file34 data. Traditionally Squashfs has decompressed into an35 intermediate buffer and then memcopied it into the page cache.36 Squashfs now supports the ability to decompress directly into37 the page cache.38 39 If unsure, select "Decompress file data into an intermediate buffer"40 41config SQUASHFS_FILE_CACHE42 bool "Decompress file data into an intermediate buffer"43 help44 Decompress file data into an intermediate buffer and then45 memcopy it into the page cache.46 47config SQUASHFS_FILE_DIRECT48 bool "Decompress files directly into the page cache"49 help50 Directly decompress file data into the page cache.51 Doing so can significantly improve performance because52 it eliminates a memcpy and it also removes the lock contention53 on the single buffer.54 55endchoice56 57config SQUASHFS_DECOMP_SINGLE58 depends on SQUASHFS59 def_bool n60 61config SQUASHFS_DECOMP_MULTI62 depends on SQUASHFS63 def_bool n64 65config SQUASHFS_DECOMP_MULTI_PERCPU66 depends on SQUASHFS67 def_bool n68 69config SQUASHFS_CHOICE_DECOMP_BY_MOUNT70 bool "Select the parallel decompression mode during mount"71 depends on SQUASHFS72 default n73 select SQUASHFS_DECOMP_SINGLE74 select SQUASHFS_DECOMP_MULTI75 select SQUASHFS_DECOMP_MULTI_PERCPU76 select SQUASHFS_MOUNT_DECOMP_THREADS77 help78 Compile all parallel decompression modes and specify the79 decompression mode by setting "threads=" during mount.80 default Decompressor parallelisation is SQUASHFS_DECOMP_SINGLE81 82choice83 prompt "Select decompression parallel mode at compile time"84 depends on SQUASHFS85 depends on !SQUASHFS_CHOICE_DECOMP_BY_MOUNT86 help87 Squashfs now supports three parallelisation options for88 decompression. Each one exhibits various trade-offs between89 decompression performance and CPU and memory usage.90 91 If in doubt, select "Single threaded compression"92 93config SQUASHFS_COMPILE_DECOMP_SINGLE94 bool "Single threaded compression"95 select SQUASHFS_DECOMP_SINGLE96 help97 Traditionally Squashfs has used single-threaded decompression.98 Only one block (data or metadata) can be decompressed at any99 one time. This limits CPU and memory usage to a minimum.100 101config SQUASHFS_COMPILE_DECOMP_MULTI102 bool "Use multiple decompressors for parallel I/O"103 select SQUASHFS_DECOMP_MULTI104 help105 By default Squashfs uses a single decompressor but it gives106 poor performance on parallel I/O workloads when using multiple CPU107 machines due to waiting on decompressor availability.108 109 If you have a parallel I/O workload and your system has enough memory,110 using this option may improve overall I/O performance.111 112 This decompressor implementation uses up to two parallel113 decompressors per core. It dynamically allocates decompressors114 on a demand basis.115 116config SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU117 bool "Use percpu multiple decompressors for parallel I/O"118 select SQUASHFS_DECOMP_MULTI_PERCPU119 help120 By default Squashfs uses a single decompressor but it gives121 poor performance on parallel I/O workloads when using multiple CPU122 machines due to waiting on decompressor availability.123 124 This decompressor implementation uses a maximum of one125 decompressor per core. It uses percpu variables to ensure126 decompression is load-balanced across the cores.127endchoice128 129config SQUASHFS_MOUNT_DECOMP_THREADS130 bool "Add the mount parameter 'threads=' for squashfs"131 depends on SQUASHFS132 depends on SQUASHFS_DECOMP_MULTI133 default n134 help135 Use threads= to set the decompression parallel mode and the number of threads.136 If SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y137 threads=<single|multi|percpu|1|2|3|...>138 else139 threads=<2|3|...>140 The upper limit is num_online_cpus() * 2.141 142config SQUASHFS_XATTR143 bool "Squashfs XATTR support"144 depends on SQUASHFS145 help146 Saying Y here includes support for extended attributes (xattrs).147 Xattrs are name:value pairs associated with inodes by148 the kernel or by users (see the attr(5) manual page).149 150 If unsure, say N.151 152config SQUASHFS_ZLIB153 bool "Include support for ZLIB compressed file systems"154 depends on SQUASHFS155 select ZLIB_INFLATE156 default y157 help158 ZLIB compression is the standard compression used by Squashfs159 file systems. It offers a good trade-off between compression160 achieved and the amount of CPU time and memory necessary to161 compress and decompress.162 163 If unsure, say Y.164 165config SQUASHFS_LZ4166 bool "Include support for LZ4 compressed file systems"167 depends on SQUASHFS168 select LZ4_DECOMPRESS169 help170 Saying Y here includes support for reading Squashfs file systems171 compressed with LZ4 compression. LZ4 compression is mainly172 aimed at embedded systems with slower CPUs where the overheads173 of zlib are too high.174 175 LZ4 is not the standard compression used in Squashfs and so most176 file systems will be readable without selecting this option.177 178 If unsure, say N.179 180config SQUASHFS_LZO181 bool "Include support for LZO compressed file systems"182 depends on SQUASHFS183 select LZO_DECOMPRESS184 help185 Saying Y here includes support for reading Squashfs file systems186 compressed with LZO compression. LZO compression is mainly187 aimed at embedded systems with slower CPUs where the overheads188 of zlib are too high.189 190 LZO is not the standard compression used in Squashfs and so most191 file systems will be readable without selecting this option.192 193 If unsure, say N.194 195config SQUASHFS_XZ196 bool "Include support for XZ compressed file systems"197 depends on SQUASHFS198 select XZ_DEC199 help200 Saying Y here includes support for reading Squashfs file systems201 compressed with XZ compression. XZ gives better compression than202 the default zlib compression, at the expense of greater CPU and203 memory overhead.204 205 XZ is not the standard compression used in Squashfs and so most206 file systems will be readable without selecting this option.207 208 If unsure, say N.209 210config SQUASHFS_ZSTD211 bool "Include support for ZSTD compressed file systems"212 depends on SQUASHFS213 select ZSTD_DECOMPRESS214 help215 Saying Y here includes support for reading Squashfs file systems216 compressed with ZSTD compression. ZSTD gives better compression than217 the default ZLIB compression, while using less CPU.218 219 ZSTD is not the standard compression used in Squashfs and so most220 file systems will be readable without selecting this option.221 222 If unsure, say N.223 224config SQUASHFS_4K_DEVBLK_SIZE225 bool "Use 4K device block size?"226 depends on SQUASHFS227 help228 By default Squashfs sets the dev block size (sb_min_blocksize)229 to 1K or the smallest block size supported by the block device230 (if larger). This, because blocks are packed together and231 unaligned in Squashfs, should reduce latency.232 233 This, however, gives poor performance on MTD NAND devices where234 the optimal I/O size is 4K (even though the devices can support235 smaller block sizes).236 237 Using a 4K device block size may also improve overall I/O238 performance for some file access patterns (e.g. sequential239 accesses of files in filesystem order) on all media.240 241 Setting this option will force Squashfs to use a 4K device block242 size by default.243 244 If unsure, say N.245 246config SQUASHFS_EMBEDDED247 bool "Additional option for memory-constrained systems"248 depends on SQUASHFS249 help250 Saying Y here allows you to specify cache size.251 252 If unsure, say N.253 254config SQUASHFS_FRAGMENT_CACHE_SIZE255 int "Number of fragments cached" if SQUASHFS_EMBEDDED256 depends on SQUASHFS257 default "3"258 help259 By default SquashFS caches the last 3 fragments read from260 the filesystem. Increasing this amount may mean SquashFS261 has to re-read fragments less often from disk, at the expense262 of extra system memory. Decreasing this amount will mean263 SquashFS uses less memory at the expense of extra reads from disk.264 265 Note there must be at least one cached fragment. Anything266 much more than three will probably not make much difference.267