What is Btrfs's disk space caching?

5

1

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

Geremia

Posted 2014-12-22T08:31:17.763

Reputation: 318

Answers

2

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.

vembutech

Posted 2014-12-22T08:31:17.763

Reputation: 5 693

2

Nicely ripped almost directly from a phoronix report.

– palswim – 2015-09-11T06:24:45.557

4

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

Arunas Bartisius

Posted 2014-12-22T08:31:17.763

Reputation: 895