Re: btrfs hash algorithm (should xxhash be the default?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 1, 2021 at 8:10 AM Kevin Kofler via devel
<devel@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Matthew Miller wrote:
>
> > On Mon, Feb 01, 2021 at 01:24:53PM +0000, David Howells wrote:
> >> Matthew Miller <mattdm@xxxxxxxxxxxxxxxxx> wrote:
> >> > Plus, it's 64 bit instead of 32 bit. The 256-bit algorithms are
> >> > obviously much, much slower and probably not right for a default, but
> >> > should we consider making xxhash the default for Fedora Linux systems
> >> > with btrfs?
> >> Does this affect what's on disk?
> >
> > Yes; it changes the checksums stored with each block to be in the selected
> > format. This can only be changed at filesystem creation time.
>
> I guess the real question is: does it increase the required disk space or
> does it only fill up bits that would otherwise be padding bits?

Both.

Data block size is equal to page size, i.e. x86 is 4KiB. And there are
4 bytes of crc32c, and 8 bytes of xxhash, per data block. These are
stored in the csum tree. So moving to xxhash will double the csum
tree. On my ~24G file system, csum tree is ~32MB with crc32c and would
be ~64MB with xxhash. So, yeah it's 200% bigger, but not significant
in terms of either CPU or IO.

Metadata block size defaults to 16KiB on x86, so in this case whether
4 bytes or 8 bytes of checksu, it's the same block size, no additional
space is used.

More info on the available hashes
https://kdave.github.io/selecting-hash-for-btrfs/

I think we should just follow upstream because we don't have a good
way to use non-default mkfs options in the installer. If upstream has
a plan to switch to xxhash by default, we can adopt it earlier than
they do just because we don't have to worry about coordinating with
longterm kernel support. e.g. right now none of these hashes are in
kernel 5.4 which is the current long term kernel. Upstream takes that
into account. Fedora doesn't need to. But since the work on xxh3 is
completed, it's an open question if that's a better candidate for a
default, or if some other candidate appears.

So yeah - we need to coordinate with upstream at least to some degree.


-- 
Chris Murphy
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux