Skip to content

Commit 0ab8c45

Browse files
committed
Handle bbssd per-line valid page count correctly
1 parent 1715760 commit 0ab8c45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hw/block/femu/bbssd/ftl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,11 @@ static void mark_page_invalid(struct ssd *ssd, struct ppa *ppa)
555555
}
556556
line->ipc++;
557557
ftl_assert(line->vpc > 0 && line->vpc <= spp->pgs_per_line);
558+
/* Adjust the position of the victime line in the pq under over-writes */
558559
if (line->pos) {
559560
pqueue_change_priority(lm->victim_line_pq, line->vpc - 1, line);
560-
} else {
561-
line->vpc--;
562561
}
562+
line->vpc--;
563563

564564
if (was_full_line) {
565565
/* move line: "full" -> "victim" */
@@ -892,6 +892,7 @@ static void *ftl_thread(void *arg)
892892
lat = ssd_read(ssd, req);
893893
break;
894894
case NVME_CMD_DSM:
895+
lat = 0;
895896
break;
896897
default:
897898
//ftl_err("FTL received unkown request type, ERROR\n");

0 commit comments

Comments
 (0)