Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) Bigalloc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) --------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) At the moment, the default size of a block is 4KiB, which is a commonly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) supported page size on most MMU-capable hardware. This is fortunate, as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) ext4 code is not prepared to handle the case where the block size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) exceeds the page size. However, for a filesystem of mostly huge files,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) it is desirable to be able to allocate disk blocks in units of multiple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) blocks to reduce both fragmentation and metadata overhead. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) bigalloc feature provides exactly this ability.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) The bigalloc feature (EXT4_FEATURE_RO_COMPAT_BIGALLOC) changes ext4 to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) use clustered allocation, so that each bit in the ext4 block allocation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) bitmap addresses a power of two number of blocks. For example, if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) file system is mainly going to be storing large files in the 4-32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) megabyte range, it might make sense to set a cluster size of 1 megabyte.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) This means that each bit in the block allocation bitmap now addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 256 4k blocks. This shrinks the total size of the block allocation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) bitmaps for a 2T file system from 64 megabytes to 256 kilobytes. It also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) means that a block group addresses 32 gigabytes instead of 128 megabytes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) also shrinking the amount of file system overhead for metadata.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) The administrator can set a block cluster size at mkfs time (which is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) stored in the s\_log\_cluster\_size field in the superblock); from then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) on, the block bitmaps track clusters, not individual blocks. This means
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) that block groups can be several gigabytes in size (instead of just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 128MiB); however, the minimum allocation unit becomes a cluster, not a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) block, even for directories. TaoBao had a patchset to extend the “use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) units of clusters instead of blocks” to the extent tree, though it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) not clear where those patches went-- they eventually morphed into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) “extent tree v2” but that code has not landed as of May 2015.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)