1 # SPDX-License-Identifier: GPL-2.0-only
3 tristate "SquashFS 4.0 - Squashed file system support"
6 Saying Y here includes support for SquashFS 4.0 (a Compressed
7 Read-Only File System). Squashfs is a highly compressed read-only
8 filesystem for Linux. It uses zlib, lzo or xz compression to
9 compress both files, inodes and directories. Inodes in the system
10 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 Mbytes
12 (default block size 128K). SquashFS 4.0 supports 64 bit filesystems
13 and files (larger than 4GB), full uid/gid information, hard links and
16 Squashfs is intended for general read-only filesystem use, for
17 archival use (i.e. in cases where a .tar.gz file may be used), and in
18 embedded systems where low overhead is needed. Further information
19 and tools are available from http://squashfs.sourceforge.net.
21 If you want to compile this as a module ( = code which can be
22 inserted in and removed from the running kernel whenever you want),
23 say M here. The module will be called squashfs. Note that the root
24 file system (the one containing the directory /) cannot be compiled
30 prompt "File decompression options"
33 Squashfs now supports two options for decompressing file
34 data. Traditionally Squashfs has decompressed into an
35 intermediate buffer and then memcopied it into the page cache.
36 Squashfs now supports the ability to decompress directly into
39 If unsure, select "Decompress file data into an intermediate buffer"
41 config SQUASHFS_FILE_CACHE
42 bool "Decompress file data into an intermediate buffer"
44 Decompress file data into an intermediate buffer and then
45 memcopy it into the page cache.
47 config SQUASHFS_FILE_DIRECT
48 bool "Decompress files directly into the page cache"
50 Directly decompress file data into the page cache.
51 Doing so can significantly improve performance because
52 it eliminates a memcpy and it also removes the lock contention
58 prompt "Decompressor parallelisation options"
61 Squashfs now supports three parallelisation options for
62 decompression. Each one exhibits various trade-offs between
63 decompression performance and CPU and memory usage.
65 If in doubt, select "Single threaded compression"
67 config SQUASHFS_DECOMP_SINGLE
68 bool "Single threaded compression"
70 Traditionally Squashfs has used single-threaded decompression.
71 Only one block (data or metadata) can be decompressed at any
72 one time. This limits CPU and memory usage to a minimum.
74 config SQUASHFS_DECOMP_MULTI
75 bool "Use multiple decompressors for parallel I/O"
77 By default Squashfs uses a single decompressor but it gives
78 poor performance on parallel I/O workloads when using multiple CPU
79 machines due to waiting on decompressor availability.
81 If you have a parallel I/O workload and your system has enough memory,
82 using this option may improve overall I/O performance.
84 This decompressor implementation uses up to two parallel
85 decompressors per core. It dynamically allocates decompressors
88 config SQUASHFS_DECOMP_MULTI_PERCPU
89 bool "Use percpu multiple decompressors for parallel I/O"
91 By default Squashfs uses a single decompressor but it gives
92 poor performance on parallel I/O workloads when using multiple CPU
93 machines due to waiting on decompressor availability.
95 This decompressor implementation uses a maximum of one
96 decompressor per core. It uses percpu variables to ensure
97 decompression is load-balanced across the cores.
101 config SQUASHFS_XATTR
102 bool "Squashfs XATTR support"
105 Saying Y here includes support for extended attributes (xattrs).
106 Xattrs are name:value pairs associated with inodes by
107 the kernel or by users (see the attr(5) manual page).
112 bool "Include support for ZLIB compressed file systems"
117 ZLIB compression is the standard compression used by Squashfs
118 file systems. It offers a good trade-off between compression
119 achieved and the amount of CPU time and memory necessary to
120 compress and decompress.
125 bool "Include support for LZ4 compressed file systems"
127 select LZ4_DECOMPRESS
129 Saying Y here includes support for reading Squashfs file systems
130 compressed with LZ4 compression. LZ4 compression is mainly
131 aimed at embedded systems with slower CPUs where the overheads
132 of zlib are too high.
134 LZ4 is not the standard compression used in Squashfs and so most
135 file systems will be readable without selecting this option.
140 bool "Include support for LZO compressed file systems"
142 select LZO_DECOMPRESS
144 Saying Y here includes support for reading Squashfs file systems
145 compressed with LZO compression. LZO compression is mainly
146 aimed at embedded systems with slower CPUs where the overheads
147 of zlib are too high.
149 LZO is not the standard compression used in Squashfs and so most
150 file systems will be readable without selecting this option.
155 bool "Include support for XZ compressed file systems"
159 Saying Y here includes support for reading Squashfs file systems
160 compressed with XZ compression. XZ gives better compression than
161 the default zlib compression, at the expense of greater CPU and
164 XZ is not the standard compression used in Squashfs and so most
165 file systems will be readable without selecting this option.
170 bool "Include support for ZSTD compressed file systems"
172 select ZSTD_DECOMPRESS
174 Saying Y here includes support for reading Squashfs file systems
175 compressed with ZSTD compression. ZSTD gives better compression than
176 the default ZLIB compression, while using less CPU.
178 ZSTD is not the standard compression used in Squashfs and so most
179 file systems will be readable without selecting this option.
183 config SQUASHFS_4K_DEVBLK_SIZE
184 bool "Use 4K device block size?"
187 By default Squashfs sets the dev block size (sb_min_blocksize)
188 to 1K or the smallest block size supported by the block device
189 (if larger). This, because blocks are packed together and
190 unaligned in Squashfs, should reduce latency.
192 This, however, gives poor performance on MTD NAND devices where
193 the optimal I/O size is 4K (even though the devices can support
194 smaller block sizes).
196 Using a 4K device block size may also improve overall I/O
197 performance for some file access patterns (e.g. sequential
198 accesses of files in filesystem order) on all media.
200 Setting this option will force Squashfs to use a 4K device block
205 config SQUASHFS_EMBEDDED
206 bool "Additional option for memory-constrained systems"
209 Saying Y here allows you to specify cache size.
213 config SQUASHFS_FRAGMENT_CACHE_SIZE
214 int "Number of fragments cached" if SQUASHFS_EMBEDDED
218 By default SquashFS caches the last 3 fragments read from
219 the filesystem. Increasing this amount may mean SquashFS
220 has to re-read fragments less often from disk, at the expense
221 of extra system memory. Decreasing this amount will mean
222 SquashFS uses less memory at the expense of extra reads from disk.
224 Note there must be at least one cached fragment. Anything
225 much more than three will probably not make much difference.