btrfs / btrfs-todo

An issues only repo to organize our TODO items
21 stars 2 forks source link

Handle reservation changes with heavy fragmentation #14

Open josefbacik opened 3 years ago

josefbacik commented 3 years ago

There's two logical holes in how we deal with delalloc reservations right now

For now using the global_rsv to save us from both scenarios is valid and ok, but in the future we're going to want to rework this so it's a little less dependent on the global_rsv. The csum calculation should be straightforward, but actually makes the second problem worse because we're growing ->size even more in the face of fragmentation.

One thought I have is bringing back the delalloc_block_rsv and using that as the global pile for all delalloc reservations. Then at least we can refill it the same way we refill the global rsv and the delayed refs rsv. The only hole we'll have at that point is the user writing and then doing literally nothing else to the file system, but again this is what the global_rsv is for.