mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-25 09:33:15 +00:00
c4663ea1a17f847fc857e4ecb5d2fe77ad5f89cd
The first pass of the item cache didn't try to reclaim freed space at all. It would leave behind very sparse pages. The oldest of which would be reclaimed by memory pressure. While this worked, it created much more stress on the system than is necessary. Splitting a page with one key also makes it hard to calculate the boundaries of the split pages, given that the start and end keys could be the single item. This adds a header field which tracks the free space in item cache pgaes. Free space is created before the alloc offset by removing items from the rbtree, but also from shrinking item values when updating or deleting items. If we try to split a page with sufficient free space to insert the largest possible item then we compact the page instead of splitting it. We copy the items into the front of an unused page and swap the pages. Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
6.9 MiB
Languages
C
86.3%
Shell
10%
Roff
2.5%
TeX
0.8%
Makefile
0.4%