What is Btrfs's disk space caching?

10,879

Solution 1

This space_cache option will be selected while mounting a mount point which has Btrfs file system. This will store the free space cache on the disk to make the caching of a block much faster. Without this, Btrfs has to scan the entire tree every time looking for the free space that can be allocated.

Solution 2

Short and to the point:

if enabled, Kernel will have available FS free space block addresses in memory, thus when you create a new file it will immediately start writing data to disk.

More details:

the mount option space_cache now is the default on recent kernels. It provides better performance, when creating new files or writing new data to disk. Please see link. You can disable it by adding nospace_cache mount option.

nospace_cache since: 3.2, space_cache=v1 and space_cache=v2 since 4.5, default: space_cache=v1

Share:
10,879

Related videos on Youtube

Geremia
Author by

Geremia

☧ vincit! ☧ regnat! ☧ imperat! Bitcoin tip jar: 1FyW7qCuuh1zAudAwa9sEEvjdaS4XE11n8 Tox ID: 65C3E8810738AD9D175234808FCB317A1103632903436203D45411AE97C03F54C34861AB6663

Updated on September 18, 2022

Comments

  • Geremia
    Geremia almost 2 years

    I noticed in my syslog that BTRFS reports enabling "disk space caching". What is Btrfs's "disk space caching"?

  • palswim
    palswim almost 9 years
    Nicely ripped almost directly from a phoronix report.