Kconfig 10.0 KB

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