1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 222635ec9SAlexey Dobriyanconfig SQUASHFS 322635ec9SAlexey Dobriyan tristate "SquashFS 4.0 - Squashed file system support" 422635ec9SAlexey Dobriyan depends on BLOCK 522635ec9SAlexey Dobriyan help 622635ec9SAlexey Dobriyan Saying Y here includes support for SquashFS 4.0 (a Compressed 722635ec9SAlexey Dobriyan Read-Only File System). Squashfs is a highly compressed read-only 8681ffe2eSPhillip Lougher filesystem for Linux. It uses zlib, lzo or xz compression to 9681ffe2eSPhillip Lougher compress both files, inodes and directories. Inodes in the system 10681ffe2eSPhillip Lougher are very small and all blocks are packed to minimise data overhead. 11681ffe2eSPhillip Lougher Block sizes greater than 4K are supported up to a maximum of 1 Mbytes 12681ffe2eSPhillip Lougher (default block size 128K). SquashFS 4.0 supports 64 bit filesystems 13681ffe2eSPhillip Lougher and files (larger than 4GB), full uid/gid information, hard links and 1422635ec9SAlexey Dobriyan timestamps. 1522635ec9SAlexey Dobriyan 1622635ec9SAlexey Dobriyan Squashfs is intended for general read-only filesystem use, for 1722635ec9SAlexey Dobriyan archival use (i.e. in cases where a .tar.gz file may be used), and in 1822635ec9SAlexey Dobriyan embedded systems where low overhead is needed. Further information 1922635ec9SAlexey Dobriyan and tools are available from http://squashfs.sourceforge.net. 2022635ec9SAlexey Dobriyan 2122635ec9SAlexey Dobriyan If you want to compile this as a module ( = code which can be 2222635ec9SAlexey Dobriyan inserted in and removed from the running kernel whenever you want), 23395cf969SPaul Bolle say M here. The module will be called squashfs. Note that the root 24395cf969SPaul Bolle file system (the one containing the directory /) cannot be compiled 25395cf969SPaul Bolle as a module. 2622635ec9SAlexey Dobriyan 2722635ec9SAlexey Dobriyan If unsure, say N. 2822635ec9SAlexey Dobriyan 29d208383dSPhillip Lougherchoice 300d455c12SPhillip Lougher prompt "File decompression options" 310d455c12SPhillip Lougher depends on SQUASHFS 320d455c12SPhillip Lougher help 330d455c12SPhillip Lougher Squashfs now supports two options for decompressing file 340d455c12SPhillip Lougher data. Traditionally Squashfs has decompressed into an 350d455c12SPhillip Lougher intermediate buffer and then memcopied it into the page cache. 360d455c12SPhillip Lougher Squashfs now supports the ability to decompress directly into 370d455c12SPhillip Lougher the page cache. 380d455c12SPhillip Lougher 390d455c12SPhillip Lougher If unsure, select "Decompress file data into an intermediate buffer" 400d455c12SPhillip Lougher 410d455c12SPhillip Lougherconfig SQUASHFS_FILE_CACHE 420d455c12SPhillip Lougher bool "Decompress file data into an intermediate buffer" 430d455c12SPhillip Lougher help 440d455c12SPhillip Lougher Decompress file data into an intermediate buffer and then 450d455c12SPhillip Lougher memcopy it into the page cache. 460d455c12SPhillip Lougher 470d455c12SPhillip Lougherconfig SQUASHFS_FILE_DIRECT 480d455c12SPhillip Lougher bool "Decompress files directly into the page cache" 490d455c12SPhillip Lougher help 500d455c12SPhillip Lougher Directly decompress file data into the page cache. 510d455c12SPhillip Lougher Doing so can significantly improve performance because 520d455c12SPhillip Lougher it eliminates a memcpy and it also removes the lock contention 530d455c12SPhillip Lougher on the single buffer. 540d455c12SPhillip Lougher 550d455c12SPhillip Lougherendchoice 560d455c12SPhillip Lougher 57*80f78409SXiaoming Niconfig SQUASHFS_DECOMP_SINGLE 58d208383dSPhillip Lougher depends on SQUASHFS 59*80f78409SXiaoming Ni def_bool n 60*80f78409SXiaoming Ni 61*80f78409SXiaoming Niconfig SQUASHFS_DECOMP_MULTI 62*80f78409SXiaoming Ni depends on SQUASHFS 63*80f78409SXiaoming Ni def_bool n 64*80f78409SXiaoming Ni 65*80f78409SXiaoming Niconfig SQUASHFS_DECOMP_MULTI_PERCPU 66*80f78409SXiaoming Ni depends on SQUASHFS 67*80f78409SXiaoming Ni def_bool n 68*80f78409SXiaoming Ni 69*80f78409SXiaoming Niconfig SQUASHFS_CHOICE_DECOMP_BY_MOUNT 70*80f78409SXiaoming Ni bool "Select the parallel decompression mode during mount" 71*80f78409SXiaoming Ni depends on SQUASHFS 72*80f78409SXiaoming Ni default n 73*80f78409SXiaoming Ni select SQUASHFS_DECOMP_SINGLE 74*80f78409SXiaoming Ni select SQUASHFS_DECOMP_MULTI 75*80f78409SXiaoming Ni select SQUASHFS_DECOMP_MULTI_PERCPU 76*80f78409SXiaoming Ni help 77*80f78409SXiaoming Ni Compile all parallel decompression modes and specify the 78*80f78409SXiaoming Ni decompression mode by setting "threads=" during mount. 79*80f78409SXiaoming Ni threads=<single|multi|percpu> 80*80f78409SXiaoming Ni 81*80f78409SXiaoming Ni default Decompressor parallelisation is SQUASHFS_DECOMP_SINGLE 82*80f78409SXiaoming Ni 83*80f78409SXiaoming Nichoice 84*80f78409SXiaoming Ni prompt "Select decompression parallel mode at compile time" 85*80f78409SXiaoming Ni depends on SQUASHFS 86*80f78409SXiaoming Ni depends on !SQUASHFS_CHOICE_DECOMP_BY_MOUNT 87d208383dSPhillip Lougher help 88d208383dSPhillip Lougher Squashfs now supports three parallelisation options for 89d208383dSPhillip Lougher decompression. Each one exhibits various trade-offs between 90d208383dSPhillip Lougher decompression performance and CPU and memory usage. 91d208383dSPhillip Lougher 92d208383dSPhillip Lougher If in doubt, select "Single threaded compression" 93d208383dSPhillip Lougher 94*80f78409SXiaoming Niconfig SQUASHFS_COMPILE_DECOMP_SINGLE 95d208383dSPhillip Lougher bool "Single threaded compression" 96*80f78409SXiaoming Ni select SQUASHFS_DECOMP_SINGLE 97d208383dSPhillip Lougher help 98d208383dSPhillip Lougher Traditionally Squashfs has used single-threaded decompression. 99d208383dSPhillip Lougher Only one block (data or metadata) can be decompressed at any 100d208383dSPhillip Lougher one time. This limits CPU and memory usage to a minimum. 101d208383dSPhillip Lougher 102*80f78409SXiaoming Niconfig SQUASHFS_COMPILE_DECOMP_MULTI 103d208383dSPhillip Lougher bool "Use multiple decompressors for parallel I/O" 104*80f78409SXiaoming Ni select SQUASHFS_DECOMP_MULTI 105d208383dSPhillip Lougher help 106d208383dSPhillip Lougher By default Squashfs uses a single decompressor but it gives 107d208383dSPhillip Lougher poor performance on parallel I/O workloads when using multiple CPU 108d208383dSPhillip Lougher machines due to waiting on decompressor availability. 109d208383dSPhillip Lougher 110d208383dSPhillip Lougher If you have a parallel I/O workload and your system has enough memory, 111d208383dSPhillip Lougher using this option may improve overall I/O performance. 112d208383dSPhillip Lougher 113d208383dSPhillip Lougher This decompressor implementation uses up to two parallel 114d208383dSPhillip Lougher decompressors per core. It dynamically allocates decompressors 115d208383dSPhillip Lougher on a demand basis. 116d208383dSPhillip Lougher 117*80f78409SXiaoming Niconfig SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU 118d208383dSPhillip Lougher bool "Use percpu multiple decompressors for parallel I/O" 119*80f78409SXiaoming Ni select SQUASHFS_DECOMP_MULTI_PERCPU 120d208383dSPhillip Lougher help 121d208383dSPhillip Lougher By default Squashfs uses a single decompressor but it gives 122d208383dSPhillip Lougher poor performance on parallel I/O workloads when using multiple CPU 123d208383dSPhillip Lougher machines due to waiting on decompressor availability. 124d208383dSPhillip Lougher 125d208383dSPhillip Lougher This decompressor implementation uses a maximum of one 126d208383dSPhillip Lougher decompressor per core. It uses percpu variables to ensure 127d208383dSPhillip Lougher decompression is load-balanced across the cores. 128d208383dSPhillip Lougherendchoice 129d208383dSPhillip Lougher 130637d5c9aSPhillip Lougherconfig SQUASHFS_XATTR 13101e5b4e4SPhillip Lougher bool "Squashfs XATTR support" 13201e5b4e4SPhillip Lougher depends on SQUASHFS 13301e5b4e4SPhillip Lougher help 13401e5b4e4SPhillip Lougher Saying Y here includes support for extended attributes (xattrs). 13501e5b4e4SPhillip Lougher Xattrs are name:value pairs associated with inodes by 13601e5b4e4SPhillip Lougher the kernel or by users (see the attr(5) manual page). 13701e5b4e4SPhillip Lougher 13801e5b4e4SPhillip Lougher If unsure, say N. 13901e5b4e4SPhillip Lougher 140cc6d3497SPhillip Lougherconfig SQUASHFS_ZLIB 141cc6d3497SPhillip Lougher bool "Include support for ZLIB compressed file systems" 142cc6d3497SPhillip Lougher depends on SQUASHFS 143cc6d3497SPhillip Lougher select ZLIB_INFLATE 144cc6d3497SPhillip Lougher default y 145cc6d3497SPhillip Lougher help 146cc6d3497SPhillip Lougher ZLIB compression is the standard compression used by Squashfs 147cc6d3497SPhillip Lougher file systems. It offers a good trade-off between compression 148cc6d3497SPhillip Lougher achieved and the amount of CPU time and memory necessary to 149cc6d3497SPhillip Lougher compress and decompress. 150cc6d3497SPhillip Lougher 151cc6d3497SPhillip Lougher If unsure, say Y. 152cc6d3497SPhillip Lougher 15362421645SPhillip Lougherconfig SQUASHFS_LZ4 15462421645SPhillip Lougher bool "Include support for LZ4 compressed file systems" 15562421645SPhillip Lougher depends on SQUASHFS 15662421645SPhillip Lougher select LZ4_DECOMPRESS 15762421645SPhillip Lougher help 15862421645SPhillip Lougher Saying Y here includes support for reading Squashfs file systems 15962421645SPhillip Lougher compressed with LZ4 compression. LZ4 compression is mainly 16062421645SPhillip Lougher aimed at embedded systems with slower CPUs where the overheads 16162421645SPhillip Lougher of zlib are too high. 16262421645SPhillip Lougher 16362421645SPhillip Lougher LZ4 is not the standard compression used in Squashfs and so most 16462421645SPhillip Lougher file systems will be readable without selecting this option. 16562421645SPhillip Lougher 16662421645SPhillip Lougher If unsure, say N. 16762421645SPhillip Lougher 16879cb8cedSChan Jeongconfig SQUASHFS_LZO 16979cb8cedSChan Jeong bool "Include support for LZO compressed file systems" 17079cb8cedSChan Jeong depends on SQUASHFS 17179cb8cedSChan Jeong select LZO_DECOMPRESS 1724b676d2dSPhillip Lougher help 1734b676d2dSPhillip Lougher Saying Y here includes support for reading Squashfs file systems 17470f23fd6SJustin P. Mattock compressed with LZO compression. LZO compression is mainly 1754b676d2dSPhillip Lougher aimed at embedded systems with slower CPUs where the overheads 1764b676d2dSPhillip Lougher of zlib are too high. 1774b676d2dSPhillip Lougher 1784b676d2dSPhillip Lougher LZO is not the standard compression used in Squashfs and so most 1794b676d2dSPhillip Lougher file systems will be readable without selecting this option. 1804b676d2dSPhillip Lougher 1814b676d2dSPhillip Lougher If unsure, say N. 18279cb8cedSChan Jeong 1837a43ae52SPhillip Lougherconfig SQUASHFS_XZ 1847a43ae52SPhillip Lougher bool "Include support for XZ compressed file systems" 1857a43ae52SPhillip Lougher depends on SQUASHFS 1867a43ae52SPhillip Lougher select XZ_DEC 1877a43ae52SPhillip Lougher help 1887a43ae52SPhillip Lougher Saying Y here includes support for reading Squashfs file systems 18970f23fd6SJustin P. Mattock compressed with XZ compression. XZ gives better compression than 1907a43ae52SPhillip Lougher the default zlib compression, at the expense of greater CPU and 1917a43ae52SPhillip Lougher memory overhead. 1927a43ae52SPhillip Lougher 1937a43ae52SPhillip Lougher XZ is not the standard compression used in Squashfs and so most 1947a43ae52SPhillip Lougher file systems will be readable without selecting this option. 1957a43ae52SPhillip Lougher 1967a43ae52SPhillip Lougher If unsure, say N. 1977a43ae52SPhillip Lougher 19887bf54bbSSean Purcellconfig SQUASHFS_ZSTD 19987bf54bbSSean Purcell bool "Include support for ZSTD compressed file systems" 20087bf54bbSSean Purcell depends on SQUASHFS 20187bf54bbSSean Purcell select ZSTD_DECOMPRESS 20287bf54bbSSean Purcell help 20387bf54bbSSean Purcell Saying Y here includes support for reading Squashfs file systems 20487bf54bbSSean Purcell compressed with ZSTD compression. ZSTD gives better compression than 20587bf54bbSSean Purcell the default ZLIB compression, while using less CPU. 20687bf54bbSSean Purcell 20787bf54bbSSean Purcell ZSTD is not the standard compression used in Squashfs and so most 20887bf54bbSSean Purcell file systems will be readable without selecting this option. 20987bf54bbSSean Purcell 21087bf54bbSSean Purcell If unsure, say N. 21187bf54bbSSean Purcell 2127657cacfSPhillip Lougherconfig SQUASHFS_4K_DEVBLK_SIZE 2137657cacfSPhillip Lougher bool "Use 4K device block size?" 2147657cacfSPhillip Lougher depends on SQUASHFS 2157657cacfSPhillip Lougher help 2167657cacfSPhillip Lougher By default Squashfs sets the dev block size (sb_min_blocksize) 2177657cacfSPhillip Lougher to 1K or the smallest block size supported by the block device 2187657cacfSPhillip Lougher (if larger). This, because blocks are packed together and 2197657cacfSPhillip Lougher unaligned in Squashfs, should reduce latency. 2207657cacfSPhillip Lougher 2217657cacfSPhillip Lougher This, however, gives poor performance on MTD NAND devices where 2227657cacfSPhillip Lougher the optimal I/O size is 4K (even though the devices can support 2237657cacfSPhillip Lougher smaller block sizes). 2247657cacfSPhillip Lougher 2257657cacfSPhillip Lougher Using a 4K device block size may also improve overall I/O 2267657cacfSPhillip Lougher performance for some file access patterns (e.g. sequential 2277657cacfSPhillip Lougher accesses of files in filesystem order) on all media. 2287657cacfSPhillip Lougher 2297657cacfSPhillip Lougher Setting this option will force Squashfs to use a 4K device block 2307657cacfSPhillip Lougher size by default. 2317657cacfSPhillip Lougher 2327657cacfSPhillip Lougher If unsure, say N. 2337657cacfSPhillip Lougher 23422635ec9SAlexey Dobriyanconfig SQUASHFS_EMBEDDED 23522635ec9SAlexey Dobriyan bool "Additional option for memory-constrained systems" 23622635ec9SAlexey Dobriyan depends on SQUASHFS 23722635ec9SAlexey Dobriyan help 23822635ec9SAlexey Dobriyan Saying Y here allows you to specify cache size. 23922635ec9SAlexey Dobriyan 24022635ec9SAlexey Dobriyan If unsure, say N. 24122635ec9SAlexey Dobriyan 24222635ec9SAlexey Dobriyanconfig SQUASHFS_FRAGMENT_CACHE_SIZE 24322635ec9SAlexey Dobriyan int "Number of fragments cached" if SQUASHFS_EMBEDDED 24422635ec9SAlexey Dobriyan depends on SQUASHFS 24522635ec9SAlexey Dobriyan default "3" 24622635ec9SAlexey Dobriyan help 24722635ec9SAlexey Dobriyan By default SquashFS caches the last 3 fragments read from 24822635ec9SAlexey Dobriyan the filesystem. Increasing this amount may mean SquashFS 24922635ec9SAlexey Dobriyan has to re-read fragments less often from disk, at the expense 25022635ec9SAlexey Dobriyan of extra system memory. Decreasing this amount will mean 25122635ec9SAlexey Dobriyan SquashFS uses less memory at the expense of extra reads from disk. 25222635ec9SAlexey Dobriyan 25322635ec9SAlexey Dobriyan Note there must be at least one cached fragment. Anything 25422635ec9SAlexey Dobriyan much more than three will probably not make much difference. 255