0001 # SPDX-License-Identifier: GPL-2.0-only
0002 config SQUASHFS
0003 tristate "SquashFS 4.0 - Squashed file system support"
0004 depends on BLOCK
0005 help
0006 Saying Y here includes support for SquashFS 4.0 (a Compressed
0007 Read-Only File System). Squashfs is a highly compressed read-only
0008 filesystem for Linux. It uses zlib, lzo or xz compression to
0009 compress both files, inodes and directories. Inodes in the system
0010 are very small and all blocks are packed to minimise data overhead.
0011 Block sizes greater than 4K are supported up to a maximum of 1 Mbytes
0012 (default block size 128K). SquashFS 4.0 supports 64 bit filesystems
0013 and files (larger than 4GB), full uid/gid information, hard links and
0014 timestamps.
0015
0016 Squashfs is intended for general read-only filesystem use, for
0017 archival use (i.e. in cases where a .tar.gz file may be used), and in
0018 embedded systems where low overhead is needed. Further information
0019 and tools are available from http://squashfs.sourceforge.net.
0020
0021 If you want to compile this as a module ( = code which can be
0022 inserted in and removed from the running kernel whenever you want),
0023 say M here. The module will be called squashfs. Note that the root
0024 file system (the one containing the directory /) cannot be compiled
0025 as a module.
0026
0027 If unsure, say N.
0028
0029 choice
0030 prompt "File decompression options"
0031 depends on SQUASHFS
0032 help
0033 Squashfs now supports two options for decompressing file
0034 data. Traditionally Squashfs has decompressed into an
0035 intermediate buffer and then memcopied it into the page cache.
0036 Squashfs now supports the ability to decompress directly into
0037 the page cache.
0038
0039 If unsure, select "Decompress file data into an intermediate buffer"
0040
0041 config SQUASHFS_FILE_CACHE
0042 bool "Decompress file data into an intermediate buffer"
0043 help
0044 Decompress file data into an intermediate buffer and then
0045 memcopy it into the page cache.
0046
0047 config SQUASHFS_FILE_DIRECT
0048 bool "Decompress files directly into the page cache"
0049 help
0050 Directly decompress file data into the page cache.
0051 Doing so can significantly improve performance because
0052 it eliminates a memcpy and it also removes the lock contention
0053 on the single buffer.
0054
0055 endchoice
0056
0057 choice
0058 prompt "Decompressor parallelisation options"
0059 depends on SQUASHFS
0060 help
0061 Squashfs now supports three parallelisation options for
0062 decompression. Each one exhibits various trade-offs between
0063 decompression performance and CPU and memory usage.
0064
0065 If in doubt, select "Single threaded compression"
0066
0067 config SQUASHFS_DECOMP_SINGLE
0068 bool "Single threaded compression"
0069 help
0070 Traditionally Squashfs has used single-threaded decompression.
0071 Only one block (data or metadata) can be decompressed at any
0072 one time. This limits CPU and memory usage to a minimum.
0073
0074 config SQUASHFS_DECOMP_MULTI
0075 bool "Use multiple decompressors for parallel I/O"
0076 help
0077 By default Squashfs uses a single decompressor but it gives
0078 poor performance on parallel I/O workloads when using multiple CPU
0079 machines due to waiting on decompressor availability.
0080
0081 If you have a parallel I/O workload and your system has enough memory,
0082 using this option may improve overall I/O performance.
0083
0084 This decompressor implementation uses up to two parallel
0085 decompressors per core. It dynamically allocates decompressors
0086 on a demand basis.
0087
0088 config SQUASHFS_DECOMP_MULTI_PERCPU
0089 bool "Use percpu multiple decompressors for parallel I/O"
0090 help
0091 By default Squashfs uses a single decompressor but it gives
0092 poor performance on parallel I/O workloads when using multiple CPU
0093 machines due to waiting on decompressor availability.
0094
0095 This decompressor implementation uses a maximum of one
0096 decompressor per core. It uses percpu variables to ensure
0097 decompression is load-balanced across the cores.
0098
0099 endchoice
0100
0101 config SQUASHFS_XATTR
0102 bool "Squashfs XATTR support"
0103 depends on SQUASHFS
0104 help
0105 Saying Y here includes support for extended attributes (xattrs).
0106 Xattrs are name:value pairs associated with inodes by
0107 the kernel or by users (see the attr(5) manual page).
0108
0109 If unsure, say N.
0110
0111 config SQUASHFS_ZLIB
0112 bool "Include support for ZLIB compressed file systems"
0113 depends on SQUASHFS
0114 select ZLIB_INFLATE
0115 default y
0116 help
0117 ZLIB compression is the standard compression used by Squashfs
0118 file systems. It offers a good trade-off between compression
0119 achieved and the amount of CPU time and memory necessary to
0120 compress and decompress.
0121
0122 If unsure, say Y.
0123
0124 config SQUASHFS_LZ4
0125 bool "Include support for LZ4 compressed file systems"
0126 depends on SQUASHFS
0127 select LZ4_DECOMPRESS
0128 help
0129 Saying Y here includes support for reading Squashfs file systems
0130 compressed with LZ4 compression. LZ4 compression is mainly
0131 aimed at embedded systems with slower CPUs where the overheads
0132 of zlib are too high.
0133
0134 LZ4 is not the standard compression used in Squashfs and so most
0135 file systems will be readable without selecting this option.
0136
0137 If unsure, say N.
0138
0139 config SQUASHFS_LZO
0140 bool "Include support for LZO compressed file systems"
0141 depends on SQUASHFS
0142 select LZO_DECOMPRESS
0143 help
0144 Saying Y here includes support for reading Squashfs file systems
0145 compressed with LZO compression. LZO compression is mainly
0146 aimed at embedded systems with slower CPUs where the overheads
0147 of zlib are too high.
0148
0149 LZO is not the standard compression used in Squashfs and so most
0150 file systems will be readable without selecting this option.
0151
0152 If unsure, say N.
0153
0154 config SQUASHFS_XZ
0155 bool "Include support for XZ compressed file systems"
0156 depends on SQUASHFS
0157 select XZ_DEC
0158 help
0159 Saying Y here includes support for reading Squashfs file systems
0160 compressed with XZ compression. XZ gives better compression than
0161 the default zlib compression, at the expense of greater CPU and
0162 memory overhead.
0163
0164 XZ is not the standard compression used in Squashfs and so most
0165 file systems will be readable without selecting this option.
0166
0167 If unsure, say N.
0168
0169 config SQUASHFS_ZSTD
0170 bool "Include support for ZSTD compressed file systems"
0171 depends on SQUASHFS
0172 select ZSTD_DECOMPRESS
0173 help
0174 Saying Y here includes support for reading Squashfs file systems
0175 compressed with ZSTD compression. ZSTD gives better compression than
0176 the default ZLIB compression, while using less CPU.
0177
0178 ZSTD is not the standard compression used in Squashfs and so most
0179 file systems will be readable without selecting this option.
0180
0181 If unsure, say N.
0182
0183 config SQUASHFS_4K_DEVBLK_SIZE
0184 bool "Use 4K device block size?"
0185 depends on SQUASHFS
0186 help
0187 By default Squashfs sets the dev block size (sb_min_blocksize)
0188 to 1K or the smallest block size supported by the block device
0189 (if larger). This, because blocks are packed together and
0190 unaligned in Squashfs, should reduce latency.
0191
0192 This, however, gives poor performance on MTD NAND devices where
0193 the optimal I/O size is 4K (even though the devices can support
0194 smaller block sizes).
0195
0196 Using a 4K device block size may also improve overall I/O
0197 performance for some file access patterns (e.g. sequential
0198 accesses of files in filesystem order) on all media.
0199
0200 Setting this option will force Squashfs to use a 4K device block
0201 size by default.
0202
0203 If unsure, say N.
0204
0205 config SQUASHFS_EMBEDDED
0206 bool "Additional option for memory-constrained systems"
0207 depends on SQUASHFS
0208 help
0209 Saying Y here allows you to specify cache size.
0210
0211 If unsure, say N.
0212
0213 config SQUASHFS_FRAGMENT_CACHE_SIZE
0214 int "Number of fragments cached" if SQUASHFS_EMBEDDED
0215 depends on SQUASHFS
0216 default "3"
0217 help
0218 By default SquashFS caches the last 3 fragments read from
0219 the filesystem. Increasing this amount may mean SquashFS
0220 has to re-read fragments less often from disk, at the expense
0221 of extra system memory. Decreasing this amount will mean
0222 SquashFS uses less memory at the expense of extra reads from disk.
0223
0224 Note there must be at least one cached fragment. Anything
0225 much more than three will probably not make much difference.