[systemd-devel] [EXT] Re: consider dropping defrag of journals on btrfs

Chris Murphy lists at colorremedies.com
Wed Feb 10 03:15:45 UTC 2021


On Tue, Feb 9, 2021 at 8:02 AM Phillip Susi <phill at thesusis.net> wrote:
>
>
> Chris Murphy writes:
>
> > Basically correct. It will merge random writes such that they become
> > sequential writes. But it means inserts/appends/overwrites for a file
> > won't be located with the original extents.
>
> Wait, I thoguht that was only true for metadata, not normal file data
> blocks?  Well, maybe it becomes true for normal data if you enable
> compression.  Or small files that get leaf packed into the metadata
> chunk.

Both data and metadata.

>
> If it's really combining streaming writes from two different files into
> a single interleaved write to the disk, that would be really silly.

It's not interleaving. It uses delayed allocation to make random
writes into sequential writes. It's tries harder to keep file blocks
together for the nossd case. It's a bit more opportunistic with the
ssd mount option. And it also depends on the pattern of the writer.
There's btrfs heatmap to get a visual idea of these behaviors.
https://github.com/knorrie/btrfs-heatmap



-- 
Chris Murphy


More information about the systemd-devel mailing list