Please enable JavaScript.
Coggle requires JavaScript to display documents.
qcow2-rs design - Coggle Diagram
qcow2-rs design
others
generic
Qcow2Dev
file: Arc<Qcow2State>,
back_io: Option<Qcow2IO>
io: Qcow2IO
Qcow2IO
file path
implement Qcow2IOOps trait
async read
async write
async discard
need to return Future object
for join!()
tests
test by utility first
unit tests
implement policy
support read first
optimization
convert big stack buffer into heap buffer
used by new_empty()
lru cache
EWMA based LRU
avoid write lock for get_key()
use EWMA to simulate cache age
does it work reliably?
lock
map lock
cache entry rw lock
read lock for using this map
write lock for update mapping
short time
holding read lock when flushing entry to disk
prevent new updating
write map and read map
allocator
load refcount blk is triggered
flushing refcount blk slice is triggered in case of cache full
lock
refcount table
rwlock for covering read table & updating table
needs async
holding write when flushing refcount table
read lock: read entry
write lock
update in-ram entries
flushing refcount table to disk
refcount blk
mutex
cover both loading/querying/flushing/updating
device is shared among queues
external is Arc
inside device
mutex or rwlock
but uring executor doesn't support multiple task yet
meta flushing
foreground flushing
triggered when adding new entry to full cache
background flushing
triggered after writting IO is done