(In reply to Felix Niederwanger from comment #13) > (In reply to Wenruo Qu from comment #11) > > If you have some random IO workload, it's very possible that btrfs bookend > > extents are causing the problem. > > Is there a way to check the booked extents of a certain file? I have a bunch > of VM images that could be the issue, but I'd like to check this hypothesis. Pretty hard, we do not have any good way to check that. There are tools like compsize which goes TREE_SEARCH ioctl to verify each file extent, but compsize is not designed to check the bookend wasted bytes, thus it doesn't do much help. A more convieant way is to defrag that subvolume (as long as that subvolume is not snapshotted). We're moving towards enhancing fiemap sysctl to export more info, but that may even take years. Meanwhile we may want to develop a tool to do the bookend accounting soon, since it's not the first time an end user is complaining about it.