Re: [linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
Il 2021-06-29 01:00 Chris Murphy ha scritto: Pretty sure it's fixed since 4.14. https://lkml.org/lkml/2019/2/10/23 Hi Chris, the headline states "harden against duplicate fsid". Does it means that the issue is "only" less likely or it was really solved? It's not inherently slow, it's a tracking cost problem as very large numbers of extents accumulate. And it also depends on the write pattern of the guest file system. If you use Btrfs in a guest on a host using Btrfs, it's a lot more competitive. There's certainly room for improvement, possibly with some hinting to avoid writing out a metric ton of 4KiB blocks as other file systems are prone to doing, where btrfs can turn these into largely sequential writes, they lose any locality optimization the guest file system expects for subsequent reads. A lot of the locality issue is a factor on rotational devices. When talking about hundreds of thousands of extents per VM file, this has a noticeable impact on even SSDs, but the much reduced latency makes it tolerable for some scenarios. I think the main issue stems for btrfs striking to have 4K CoW extents. ZFS has a default 128K recordsize that, while commanding a fair read/modify/write overhead, works much better with HDDs (for SSDs one can lower recordize to 16K or 32K). XFS with reflink does something similar, doing CoW at 128K block granularity (we had a similar discussion in the past: https://www.spinics.net/lists/linux-xfs/msg35679.html) But I've seen similar problems with VM's on LVM thinp when making many snapshots and incurring cow, however temporary (like a btrfs nodatacow file that's subject to snapshots or reflink copies; or a backing file on xfs likewise reflink copied). There really isn't much better we can do than LVM thick in this regard. And if that's the standard bearer, it's not much different if you fallocate a nodatacow file. If I remember correctly thin LVM minimum chunk size should be 64K, making it much less prone to fragmentation. Moreover, it only CoW when a snapshot if overwritten for the first time (ZFS reallocates at each write and I think btrfs does something similar). In a distant past, I benchmarked a virtual machine running on btrfs over a fallocated+nocow files and the result was quite bleak. Maybe things have improved more than I can imagine... time for some more benchmark I suppose! Do you have any to share? Some databases are cow friendly, notably rocksdb. And sqlite with wal enabled is at least not cow unfriendly. The worst offender seems to be postgresql but I haven't seen any benchmarking since the multiple kernel series of fsync work done on btrfs to improve the performance of databases in general; that was kernel 5.8 through 5.11. Yeah, both PostgreSQL and MySQL tend to be slow on btrfs. Regards. -- Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: g.da...@assyoma.it - i...@assyoma.it GPG public key ID: FF5F32A8 ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Re: [linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
On Mon, Jun 28, 2021 at 1:33 AM Gionatan Danti wrote: > > Il 2021-06-28 05:28 Stuart D Gathman ha scritto: > > Yes. I like the checksums in metadata feature for enhanced integrity > > checking. > > Until recently btrfs has issue when a LVM snapshot was mounted. It is > now solved? Pretty sure it's fixed since 4.14. https://lkml.org/lkml/2019/2/10/23 > That said, for rewrite-heavy workload (virtual machines, databases, etc) > btrfs is very slow (and disabling CoW is not a solution for me, as it > also disables checksum, compression, etc). It's not inherently slow, it's a tracking cost problem as very large numbers of extents accumulate. And it also depends on the write pattern of the guest file system. If you use Btrfs in a guest on a host using Btrfs, it's a lot more competitive. There's certainly room for improvement, possibly with some hinting to avoid writing out a metric ton of 4KiB blocks as other file systems are prone to doing, where btrfs can turn these into largely sequential writes, they lose any locality optimization the guest file system expects for subsequent reads. A lot of the locality issue is a factor on rotational devices. When talking about hundreds of thousands of extents per VM file, this has a noticeable impact on even SSDs, but the much reduced latency makes it tolerable for some scenarios. But I've seen similar problems with VM's on LVM thinp when making many snapshots and incurring cow, however temporary (like a btrfs nodatacow file that's subject to snapshots or reflink copies; or a backing file on xfs likewise reflink copied). There really isn't much better we can do than LVM thick in this regard. And if that's the standard bearer, it's not much different if you fallocate a nodatacow file. Some databases are cow friendly, notably rocksdb. And sqlite with wal enabled is at least not cow unfriendly. The worst offender seems to be postgresql but I haven't seen any benchmarking since the multiple kernel series of fsync work done on btrfs to improve the performance of databases in general; that was kernel 5.8 through 5.11. -- Chris Murphy ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Re: [linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
Il 2021-06-28 05:28 Stuart D Gathman ha scritto: Yes. I like the checksums in metadata feature for enhanced integrity checking. Until recently btrfs has issue when a LVM snapshot was mounted. It is now solved? It seems too complicated to have anytime soon - but when a filesystem detects corruption, and is on an LVM (or md) RAID1 layer, an ioctl to read alternate mirror branches to see which (if any) has the correct data would allow recovery. Btrfs does this if it is doing the mirroring, but then you lose all the other features from LVM or md raid10, including running other filesystems and efficient virtual disks for virtual machines. For this to work, LVM should be able to identify the corrupted data. Without checksum, how can you do that? The solution is to use dm-integrity under the RAID layer. It works pretty well, letting apart the big performance drop in the default (journaled) configuration (bitmap is faster, but leave a small window for corruption to happen undetected). That said, for rewrite-heavy workload (virtual machines, databases, etc) btrfs is very slow (and disabling CoW is not a solution for me, as it also disables checksum, compression, etc). We eventually got DISCARD operations to pass to lower layers. Dealing with mirror branches should really be a thing too. As said above, the issue is not to read from the mirror leg separately; rather, to detect *which* mirror leg contains valid data. Regards. -- Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: g.da...@assyoma.it - i...@assyoma.it GPG public key ID: FF5F32A8 ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Re: [linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
On Mon, 28 Jun 2021, heming.z...@suse.com wrote: In my opinion, the using style of btrfs by many users are same as ext4/xfs. Yes. I like the checksums in metadata feature for enhanced integrity checking. It seems too complicated to have anytime soon - but when a filesystem detects corruption, and is on an LVM (or md) RAID1 layer, an ioctl to read alternate mirror branches to see which (if any) has the correct data would allow recovery. Btrfs does this if it is doing the mirroring, but then you lose all the other features from LVM or md raid10, including running other filesystems and efficient virtual disks for virtual machines. We eventually got DISCARD operations to pass to lower layers. Dealing with mirror branches should really be a thing too. ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Re: [linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
On 6/25/21 6:57 PM, Zdenek Kabelac wrote: Dne 25. 06. 21 v 7:28 heming.z...@suse.com napsal(a): Hello Zdenek & David, From URL: https://fedoraproject.org/wiki/Btrfs The btrfs becomes default filesystem for desktops. Do we have any plan to add btrfs code for scripts/fsadm.sh? If the answer is yes. I could share a suse special patch, this patch had been run about 4 years in suse products. Hi If you have some patches provided with some good usable testing (lvm2 test suite) - it could be possibly merged. Patch for fsadm is already many years ago, but test suite is empty. I plan to add some test cases then file the patch files. On the other hand helping/suggesting users to use Btrfs on top of lvm2 has also its logical 'question' marks. Since btrfs users should probably be avoiding placing 'another' layer between real hw - when btrfs should be mostly capable handling lvm2 features in its 'very own' way. Each layer has it's own measurable costs. And yeah we do not want to be involved into btrfs related recovery cases, as we simply never understood its handling of attached disks. In my opinion, the using style of btrfs by many users are same as ext4/xfs. btrfs has lots of features, but there are MAY experimental or not stable. Users prefer to use btrfs core functionality. And not to speak of compatible reasons, in many scenarios, btrfs still works with lvm or mdadm. For minimal code design (minimal bug occur), in fsadm, we only treat btrfs as another ext4/xfs style filesystem. "fsadm resize" executes "btrfs resize" "fsadm check" executes "btrfs scrub" Thanks, Heming ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Re: [linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
Dne 25. 06. 21 v 7:28 heming.z...@suse.com napsal(a): Hello Zdenek & David, From URL: https://fedoraproject.org/wiki/Btrfs The btrfs becomes default filesystem for desktops. Do we have any plan to add btrfs code for scripts/fsadm.sh? If the answer is yes. I could share a suse special patch, this patch had been run about 4 years in suse products. Hi If you have some patches provided with some good usable testing (lvm2 test suite) - it could be possibly merged. On the other hand helping/suggesting users to use Btrfs on top of lvm2 has also its logical 'question' marks. Since btrfs users should probably be avoiding placing 'another' layer between real hw - when btrfs should be mostly capable handling lvm2 features in its 'very own' way. Each layer has it's own measurable costs. And yeah we do not want to be involved into btrfs related recovery cases, as we simply never understood its handling of attached disks. Regards Zdenek ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
[linux-lvm] Does LVM have any plan/schedule to support btrfs in fsadm
Hello Zdenek & David, From URL: https://fedoraproject.org/wiki/Btrfs The btrfs becomes default filesystem for desktops. Do we have any plan to add btrfs code for scripts/fsadm.sh? If the answer is yes. I could share a suse special patch, this patch had been run about 4 years in suse products. Thanks, Heming ___ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/