1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only 2*4882a593Smuzhiyunconfig SQUASHFS 3*4882a593Smuzhiyun tristate "SquashFS 4.0 - Squashed file system support" 4*4882a593Smuzhiyun depends on BLOCK 5*4882a593Smuzhiyun help 6*4882a593Smuzhiyun Saying Y here includes support for SquashFS 4.0 (a Compressed 7*4882a593Smuzhiyun Read-Only File System). Squashfs is a highly compressed read-only 8*4882a593Smuzhiyun filesystem for Linux. It uses zlib, lzo or xz compression to 9*4882a593Smuzhiyun compress both files, inodes and directories. Inodes in the system 10*4882a593Smuzhiyun are very small and all blocks are packed to minimise data overhead. 11*4882a593Smuzhiyun Block sizes greater than 4K are supported up to a maximum of 1 Mbytes 12*4882a593Smuzhiyun (default block size 128K). SquashFS 4.0 supports 64 bit filesystems 13*4882a593Smuzhiyun and files (larger than 4GB), full uid/gid information, hard links and 14*4882a593Smuzhiyun timestamps. 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun Squashfs is intended for general read-only filesystem use, for 17*4882a593Smuzhiyun archival use (i.e. in cases where a .tar.gz file may be used), and in 18*4882a593Smuzhiyun embedded systems where low overhead is needed. Further information 19*4882a593Smuzhiyun and tools are available from http://squashfs.sourceforge.net. 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun If you want to compile this as a module ( = code which can be 22*4882a593Smuzhiyun inserted in and removed from the running kernel whenever you want), 23*4882a593Smuzhiyun say M here. The module will be called squashfs. Note that the root 24*4882a593Smuzhiyun file system (the one containing the directory /) cannot be compiled 25*4882a593Smuzhiyun as a module. 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun If unsure, say N. 28*4882a593Smuzhiyun 29*4882a593Smuzhiyunchoice 30*4882a593Smuzhiyun prompt "File decompression options" 31*4882a593Smuzhiyun depends on SQUASHFS 32*4882a593Smuzhiyun help 33*4882a593Smuzhiyun Squashfs now supports two options for decompressing file 34*4882a593Smuzhiyun data. Traditionally Squashfs has decompressed into an 35*4882a593Smuzhiyun intermediate buffer and then memcopied it into the page cache. 36*4882a593Smuzhiyun Squashfs now supports the ability to decompress directly into 37*4882a593Smuzhiyun the page cache. 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun If unsure, select "Decompress file data into an intermediate buffer" 40*4882a593Smuzhiyun 41*4882a593Smuzhiyunconfig SQUASHFS_FILE_CACHE 42*4882a593Smuzhiyun bool "Decompress file data into an intermediate buffer" 43*4882a593Smuzhiyun help 44*4882a593Smuzhiyun Decompress file data into an intermediate buffer and then 45*4882a593Smuzhiyun memcopy it into the page cache. 46*4882a593Smuzhiyun 47*4882a593Smuzhiyunconfig SQUASHFS_FILE_DIRECT 48*4882a593Smuzhiyun bool "Decompress files directly into the page cache" 49*4882a593Smuzhiyun help 50*4882a593Smuzhiyun Directly decompress file data into the page cache. 51*4882a593Smuzhiyun Doing so can significantly improve performance because 52*4882a593Smuzhiyun it eliminates a memcpy and it also removes the lock contention 53*4882a593Smuzhiyun on the single buffer. 54*4882a593Smuzhiyun 55*4882a593Smuzhiyunendchoice 56*4882a593Smuzhiyun 57*4882a593Smuzhiyunchoice 58*4882a593Smuzhiyun prompt "Decompressor parallelisation options" 59*4882a593Smuzhiyun depends on SQUASHFS 60*4882a593Smuzhiyun help 61*4882a593Smuzhiyun Squashfs now supports three parallelisation options for 62*4882a593Smuzhiyun decompression. Each one exhibits various trade-offs between 63*4882a593Smuzhiyun decompression performance and CPU and memory usage. 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun If in doubt, select "Single threaded compression" 66*4882a593Smuzhiyun 67*4882a593Smuzhiyunconfig SQUASHFS_DECOMP_SINGLE 68*4882a593Smuzhiyun bool "Single threaded compression" 69*4882a593Smuzhiyun help 70*4882a593Smuzhiyun Traditionally Squashfs has used single-threaded decompression. 71*4882a593Smuzhiyun Only one block (data or metadata) can be decompressed at any 72*4882a593Smuzhiyun one time. This limits CPU and memory usage to a minimum. 73*4882a593Smuzhiyun 74*4882a593Smuzhiyunconfig SQUASHFS_DECOMP_MULTI 75*4882a593Smuzhiyun bool "Use multiple decompressors for parallel I/O" 76*4882a593Smuzhiyun help 77*4882a593Smuzhiyun By default Squashfs uses a single decompressor but it gives 78*4882a593Smuzhiyun poor performance on parallel I/O workloads when using multiple CPU 79*4882a593Smuzhiyun machines due to waiting on decompressor availability. 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun If you have a parallel I/O workload and your system has enough memory, 82*4882a593Smuzhiyun using this option may improve overall I/O performance. 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun This decompressor implementation uses up to two parallel 85*4882a593Smuzhiyun decompressors per core. It dynamically allocates decompressors 86*4882a593Smuzhiyun on a demand basis. 87*4882a593Smuzhiyun 88*4882a593Smuzhiyunconfig SQUASHFS_DECOMP_MULTI_PERCPU 89*4882a593Smuzhiyun bool "Use percpu multiple decompressors for parallel I/O" 90*4882a593Smuzhiyun help 91*4882a593Smuzhiyun By default Squashfs uses a single decompressor but it gives 92*4882a593Smuzhiyun poor performance on parallel I/O workloads when using multiple CPU 93*4882a593Smuzhiyun machines due to waiting on decompressor availability. 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun This decompressor implementation uses a maximum of one 96*4882a593Smuzhiyun decompressor per core. It uses percpu variables to ensure 97*4882a593Smuzhiyun decompression is load-balanced across the cores. 98*4882a593Smuzhiyun 99*4882a593Smuzhiyunendchoice 100*4882a593Smuzhiyun 101*4882a593Smuzhiyunconfig SQUASHFS_XATTR 102*4882a593Smuzhiyun bool "Squashfs XATTR support" 103*4882a593Smuzhiyun depends on SQUASHFS 104*4882a593Smuzhiyun help 105*4882a593Smuzhiyun Saying Y here includes support for extended attributes (xattrs). 106*4882a593Smuzhiyun Xattrs are name:value pairs associated with inodes by 107*4882a593Smuzhiyun the kernel or by users (see the attr(5) manual page). 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun If unsure, say N. 110*4882a593Smuzhiyun 111*4882a593Smuzhiyunconfig SQUASHFS_ZLIB 112*4882a593Smuzhiyun bool "Include support for ZLIB compressed file systems" 113*4882a593Smuzhiyun depends on SQUASHFS 114*4882a593Smuzhiyun select ZLIB_INFLATE 115*4882a593Smuzhiyun default y 116*4882a593Smuzhiyun help 117*4882a593Smuzhiyun ZLIB compression is the standard compression used by Squashfs 118*4882a593Smuzhiyun file systems. It offers a good trade-off between compression 119*4882a593Smuzhiyun achieved and the amount of CPU time and memory necessary to 120*4882a593Smuzhiyun compress and decompress. 121*4882a593Smuzhiyun 122*4882a593Smuzhiyun If unsure, say Y. 123*4882a593Smuzhiyun 124*4882a593Smuzhiyunconfig SQUASHFS_LZ4 125*4882a593Smuzhiyun bool "Include support for LZ4 compressed file systems" 126*4882a593Smuzhiyun depends on SQUASHFS 127*4882a593Smuzhiyun select LZ4_DECOMPRESS 128*4882a593Smuzhiyun help 129*4882a593Smuzhiyun Saying Y here includes support for reading Squashfs file systems 130*4882a593Smuzhiyun compressed with LZ4 compression. LZ4 compression is mainly 131*4882a593Smuzhiyun aimed at embedded systems with slower CPUs where the overheads 132*4882a593Smuzhiyun of zlib are too high. 133*4882a593Smuzhiyun 134*4882a593Smuzhiyun LZ4 is not the standard compression used in Squashfs and so most 135*4882a593Smuzhiyun file systems will be readable without selecting this option. 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun If unsure, say N. 138*4882a593Smuzhiyun 139*4882a593Smuzhiyunconfig SQUASHFS_LZO 140*4882a593Smuzhiyun bool "Include support for LZO compressed file systems" 141*4882a593Smuzhiyun depends on SQUASHFS 142*4882a593Smuzhiyun select LZO_DECOMPRESS 143*4882a593Smuzhiyun help 144*4882a593Smuzhiyun Saying Y here includes support for reading Squashfs file systems 145*4882a593Smuzhiyun compressed with LZO compression. LZO compression is mainly 146*4882a593Smuzhiyun aimed at embedded systems with slower CPUs where the overheads 147*4882a593Smuzhiyun of zlib are too high. 148*4882a593Smuzhiyun 149*4882a593Smuzhiyun LZO is not the standard compression used in Squashfs and so most 150*4882a593Smuzhiyun file systems will be readable without selecting this option. 151*4882a593Smuzhiyun 152*4882a593Smuzhiyun If unsure, say N. 153*4882a593Smuzhiyun 154*4882a593Smuzhiyunconfig SQUASHFS_XZ 155*4882a593Smuzhiyun bool "Include support for XZ compressed file systems" 156*4882a593Smuzhiyun depends on SQUASHFS 157*4882a593Smuzhiyun select XZ_DEC 158*4882a593Smuzhiyun help 159*4882a593Smuzhiyun Saying Y here includes support for reading Squashfs file systems 160*4882a593Smuzhiyun compressed with XZ compression. XZ gives better compression than 161*4882a593Smuzhiyun the default zlib compression, at the expense of greater CPU and 162*4882a593Smuzhiyun memory overhead. 163*4882a593Smuzhiyun 164*4882a593Smuzhiyun XZ is not the standard compression used in Squashfs and so most 165*4882a593Smuzhiyun file systems will be readable without selecting this option. 166*4882a593Smuzhiyun 167*4882a593Smuzhiyun If unsure, say N. 168*4882a593Smuzhiyun 169*4882a593Smuzhiyunconfig SQUASHFS_ZSTD 170*4882a593Smuzhiyun bool "Include support for ZSTD compressed file systems" 171*4882a593Smuzhiyun depends on SQUASHFS 172*4882a593Smuzhiyun select ZSTD_DECOMPRESS 173*4882a593Smuzhiyun help 174*4882a593Smuzhiyun Saying Y here includes support for reading Squashfs file systems 175*4882a593Smuzhiyun compressed with ZSTD compression. ZSTD gives better compression than 176*4882a593Smuzhiyun the default ZLIB compression, while using less CPU. 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun ZSTD is not the standard compression used in Squashfs and so most 179*4882a593Smuzhiyun file systems will be readable without selecting this option. 180*4882a593Smuzhiyun 181*4882a593Smuzhiyun If unsure, say N. 182*4882a593Smuzhiyun 183*4882a593Smuzhiyunconfig SQUASHFS_4K_DEVBLK_SIZE 184*4882a593Smuzhiyun bool "Use 4K device block size?" 185*4882a593Smuzhiyun depends on SQUASHFS 186*4882a593Smuzhiyun help 187*4882a593Smuzhiyun By default Squashfs sets the dev block size (sb_min_blocksize) 188*4882a593Smuzhiyun to 1K or the smallest block size supported by the block device 189*4882a593Smuzhiyun (if larger). This, because blocks are packed together and 190*4882a593Smuzhiyun unaligned in Squashfs, should reduce latency. 191*4882a593Smuzhiyun 192*4882a593Smuzhiyun This, however, gives poor performance on MTD NAND devices where 193*4882a593Smuzhiyun the optimal I/O size is 4K (even though the devices can support 194*4882a593Smuzhiyun smaller block sizes). 195*4882a593Smuzhiyun 196*4882a593Smuzhiyun Using a 4K device block size may also improve overall I/O 197*4882a593Smuzhiyun performance for some file access patterns (e.g. sequential 198*4882a593Smuzhiyun accesses of files in filesystem order) on all media. 199*4882a593Smuzhiyun 200*4882a593Smuzhiyun Setting this option will force Squashfs to use a 4K device block 201*4882a593Smuzhiyun size by default. 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun If unsure, say N. 204*4882a593Smuzhiyun 205*4882a593Smuzhiyunconfig SQUASHFS_EMBEDDED 206*4882a593Smuzhiyun bool "Additional option for memory-constrained systems" 207*4882a593Smuzhiyun depends on SQUASHFS 208*4882a593Smuzhiyun help 209*4882a593Smuzhiyun Saying Y here allows you to specify cache size. 210*4882a593Smuzhiyun 211*4882a593Smuzhiyun If unsure, say N. 212*4882a593Smuzhiyun 213*4882a593Smuzhiyunconfig SQUASHFS_FRAGMENT_CACHE_SIZE 214*4882a593Smuzhiyun int "Number of fragments cached" if SQUASHFS_EMBEDDED 215*4882a593Smuzhiyun depends on SQUASHFS 216*4882a593Smuzhiyun default "3" 217*4882a593Smuzhiyun help 218*4882a593Smuzhiyun By default SquashFS caches the last 3 fragments read from 219*4882a593Smuzhiyun the filesystem. Increasing this amount may mean SquashFS 220*4882a593Smuzhiyun has to re-read fragments less often from disk, at the expense 221*4882a593Smuzhiyun of extra system memory. Decreasing this amount will mean 222*4882a593Smuzhiyun SquashFS uses less memory at the expense of extra reads from disk. 223*4882a593Smuzhiyun 224*4882a593Smuzhiyun Note there must be at least one cached fragment. Anything 225*4882a593Smuzhiyun much more than three will probably not make much difference. 226