You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writeboost implements read-caching using write-caching.
The algorithm is:
Only caches 4KB (full-sized) read requests
Hold read data into the read-cache cells in the endio callback (read_cache_cell_copy_data). There are 2048 cells preallocated by default. reserve_read_cache_cell is called when the read request result in cache miss, will be read from the backing store, and the function reserves a new cell. In endio, the read data payload is copied to the cell.
Once all cells are occupied writeboost injects the read data in the cells into the write-caching routine. (inject_read_cache) This is something like read-requests turn into writers. But the code path is simpler than the real write path because the data is assured to be 4KB (not partial) and there is no chance of overwriting the existing cache block because the cell data should have been cancelled if other thread in write-caching wrote the same address. (might_cancel_read_cache_cell)
structread_cache_cell {
sector_tsector;
void*data; /* 4KB data read */boolcancelled; /* Don't include this */structrb_noderb_node;
};