Btrfs, the advanced Copy-on-Write (CoW) filesystem, is set to receive significant updates in the upcoming Linux 6.15 kernel. David Sterba from SUSE has submitted an extensive series of improvements, bringing faster compression options, improved performance, and refinements aimed at stability and scalability.
One of the standout features of this release is the introduction of fast and realtime Zstd compression levels, ranging from -1 to -15. Users can now prioritize speed over compression ratio using mount options like compress=zstd:-5
. Benchmarks indicate that this approach reduces decompression times by up to 5%, with improvements of over 15% in highly compressed files when using musl libc environments.
Additionally, the defrag ioctl
has been updated to accept these negative compression levels, further enhancing flexibility for system administrators managing fragmented data.
Another critical change allows Btrfs to fall back to buffered writes when direct I/O is attempted on files requiring checksums. While this may slightly impact performance, it prevents checksum mismatch errors, which are particularly relevant for virtual machine disk images.
The subpage mode, which supports efficient metadata handling on architectures with 4K pages, is now considered complete and stable, with all warning messages removed in this release.
Performance optimizations include:
- Enhanced file path caching in the send process, improving runtime by up to 30% for certain workloads.
- Improved encoded read paths that avoid memory allocations in synchronous mode.
- Better hardware acceleration utilization on s390x systems with hardware-supported zlib compression.
Internally, Btrfs has undergone:
- API improvements for large folio support.
- Refactored code for cleaner memory management.
- Better handling of block group reference counts.
- Optimized delayed I/O and inode cleanup processes.
- Preparations for supporting larger block sizes in future kernel versions.
All these updates are available in the official Linux repository under the for-6.15-tag
.
Comparative Table: Btrfs vs. EXT4
Feature | Btrfs | EXT4 |
---|---|---|
Type | Copy-on-Write (CoW) filesystem with advanced features | Traditional journaling filesystem |
Compression | Native support for transparent compression (Zstd, LZO, Zlib) | No native compression support |
Snapshots | Built-in support for snapshots and subvolumes | Not natively supported (requires LVM or external tools) |
RAID support | Native RAID 0, 1, 10, 5, 6 (with some caveats) | Not supported natively |
Data integrity | Checksumming of data and metadata, automatic detection of corruption | Journaling only for metadata, no data checksum |
Scalability | Supports very large files and volumes (up to exabytes) | Supports volumes up to 1 exabyte, files up to 16 TB |
Performance | Slightly lower in sequential workloads, excels in complex and mixed operations | Excellent performance in sequential reads/writes |
Defragmentation | Online defragmentation support with compression optimization | Online defragmentation available but without compression awareness |
Filesystem repair | Built-in repair tools, though still considered less mature | Mature and stable fsck repair tools |
Subvolumes | Supported, allowing flexible layouts within a single filesystem | Not supported |
Filesystem resizing | Supports online resizing (both grow and shrink) | Supports online grow; shrink only offline |
Stability and maturity | Considered stable for most use cases, actively developed but complex features can have bugs | Very mature and stable, default in many distributions |
Best use cases | Complex enterprise setups, data integrity-critical systems, virtual machines, and backup servers | Desktops, servers requiring maximum stability and predictable performance |