Skip to content

Commit 9638585

Browse files
committed
Revert bbssd line->vpc updating logic (MoatLab#65)
1 parent 0ab8c45 commit 9638585

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hw/block/femu/bbssd/ftl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,11 @@ static void mark_page_invalid(struct ssd *ssd, struct ppa *ppa)
557557
ftl_assert(line->vpc > 0 && line->vpc <= spp->pgs_per_line);
558558
/* Adjust the position of the victime line in the pq under over-writes */
559559
if (line->pos) {
560+
/* Note that line->vpc will be updated by this call */
560561
pqueue_change_priority(lm->victim_line_pq, line->vpc - 1, line);
562+
} else {
563+
line->vpc--;
561564
}
562-
line->vpc--;
563565

564566
if (was_full_line) {
565567
/* move line: "full" -> "victim" */

0 commit comments

Comments
 (0)