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
dm-writeboost uses SSD cache device like logging. It splits whole region into segments and when it reaches the last, it returns back to the first segment.
Telling the SSD device that all the cache blocks in the segment is now needless and can be reclaimed is useful because log could be partial. Partial log doesn't overwrite the segment in full extent so rest of the region that wasn't overwritten is still being recognized as non-reclaimable.
But my past experiment showed that discard is not costless so I just keep a memo.
The text was updated successfully, but these errors were encountered:
this is unlikely to occur but if we don't discard the segment everytime, the SSD controller can never realize some blocks in the segment are reclaimable because there isn't overwrite on the blocks. SSD controller can naturally realize some blocks are reclaimable when they are overwritten but otherwise no chance to realize it.
So these blocks are always kept in flash blocks inside the SSD and may cause massive copying.
If we do this, we should insert blkdev_issue_discard into
voidacquire_new_seg(structwb_device*wb, u64id)
{
structsegment_header*new_seg=get_segment_header_by_id(wb, id);
/* * We wait for all requests to the new segment is consumed. * Mutex taken guarantees that no new I/O to this segment is coming in. */wait_event(wb->inflight_ios_wq,
!atomic_read(&new_seg->nr_inflight_ios));
wait_for_writeback(wb, SUB_ID(id, wb->nr_segments));
if (count_dirty_caches_remained(new_seg)) {
DMERR("%u dirty caches remained. id:%llu",
count_dirty_caches_remained(new_seg), id);
BUG();
}
discard_caches_inseg(wb, new_seg);
// HERE
dm-writeboost uses SSD cache device like logging. It splits whole region into segments and when it reaches the last, it returns back to the first segment.
Telling the SSD device that all the cache blocks in the segment is now needless and can be reclaimed is useful because log could be partial. Partial log doesn't overwrite the segment in full extent so rest of the region that wasn't overwritten is still being recognized as non-reclaimable.
But my past experiment showed that discard is not costless so I just keep a memo.
The text was updated successfully, but these errors were encountered: