nanovms / nanos

A kernel designed to run one and only one application in a virtualized environment
https://nanos.org
Apache License 2.0
2.57k stars 133 forks source link

tfs: inflate existing file extent when appending, merge adjacent extents where possible, eliminate extent size maximum #1165

Open wjhun opened 4 years ago

wjhun commented 4 years ago

Right now we're allocating tfs extents more often than we need to. Explore the possibility of extending an existing file extent on append rather than allocating a new one. To accommodate the extension, a larger default storage allocation size could be used for each new extent, or id_heap_set_area could be used to try and extend an existing allocation (failure would just mean creating a new extent).

We could also look at merging extents that are contiguous on disk, but such conditions should become much less frequent if the above is implemented, so it's not clear how valuable such a function would be.

Once we complete the removal of all temporary buffers for retaining extent data, we can also remove the 1MB maximum extent size.

wjhun commented 4 years ago

Extension of extents to fill allocated space was merged with #1207. We can still choose to:

francescolavra commented 1 year ago

1765 implements extension of the allocated space of a given extent and removes the 1-MB upper limit on extent size.