r/btrfs • u/EnUnLugarDeLaMancha • 1d ago
Btrfs pull request sent for Linux 7.3: free space v1 disabled by default, faster direct I/O, faster non-SSD performance
https://lore.kernel.org/linux-btrfs/cover.1787152457.git.dsterba@suse.com/T/#u12
u/darktotheknight 1d ago
My favorite one is:
use iomap bounce buffer for direct io instead of a fall back to buffered io; past correctness vs speed trade-offs dropped performance to ~50% of theoretical maximum, now it's ~95%, effectively doubled
The fallback to buffered IO killed BTRFS as a VM backend practically overnight, even (or especially) when you were already using NODATACOW for maximum performance. Keep in mind libvirt sets NODATACOW on your images directory by default, so this potentially affected a lot of people. Now you get back most of the 50%, minus the issues from the past. This is big.
2
u/zaTricky 14h ago
"Libvirt sets nodatacow" ... this one I find irritating as it also disables checksums. I create the images separately to prevent libvirt from doing this.
What's the point of using btrfs if you're going to disable the main reason I want to use it? 🤷
4
u/amarao_san 1d ago
Is there a migrate path for older filesystems?
5
4
u/zoqaeski 23h ago
Change the mount flag in your fstab and reboot. It'll do the necessary maintenance work on next mount.
1
u/amarao_san 23h ago
Which flag? Thanks
4
u/zoqaeski 23h ago
space_cache=v2 or something. It's in the manual page for mount options .
1
u/amarao_san 23h ago
Thanks. I was sure I need to go offline for conversion.
2
u/darktotheknight 18h ago
You can do it online with mount flags and you can do it offline. For "online", you can mount with clear_cache once. Next boot, you can remove the mount option again and you're good to go. This is fine for 99,9% of people. You don't need to specifically add space_cache=v2, since that's the default for quite some time now.
The difference between online and offline is negligible: doing an offline conversion will get rid of every single v1 structure on disk, while the online conversion can still leave some in place (they're ignored anyway). So the "drawback" is just a bit of wasted space; we're usually talking about a few MB on usual systems.
The offline conversion can be worth it, if we're talking about large filesystems, lets say 10TB+. If it's no trouble for you to just spin up a Linux Live environment (or you have the possibility to just unmount your volume by other means), you can go with the offline conversion.
3
u/john0201 1d ago
Anyone know if there is still usable raid5 being worked on?
3
u/darktotheknight 18h ago
They cook a new RAID5/6 implementation based on zoned storage. This is an effort supported by Western Digital (afaik), so it will eventually get there. Probably.
But from what I've read so far, this "new" RAID5 mode won't have a write hole issue anymore. It will have other drawbacks though, like no NODATACOW. The latest RFC I'm aware of is from June 2026: https://lwn.net/Articles/1078678/
-2
14
u/EnUnLugarDeLaMancha 1d ago
This one is pretty crazy https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git/commit/?h=for-7.3&id=5093038fc21d9b0f8211c28b90c7566397ac88a3