From 9638585588c9671083fe56d84ce5bf9f8f7992ea Mon Sep 17 00:00:00 2001 From: Huaicheng Li Date: Mon, 18 Oct 2021 13:22:41 -0500 Subject: [PATCH] Revert bbssd line->vpc updating logic (#65) --- hw/block/femu/bbssd/ftl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/femu/bbssd/ftl.c b/hw/block/femu/bbssd/ftl.c index e32015d502d..bd9cd48aa83 100644 --- a/hw/block/femu/bbssd/ftl.c +++ b/hw/block/femu/bbssd/ftl.c @@ -557,9 +557,11 @@ static void mark_page_invalid(struct ssd *ssd, struct ppa *ppa) ftl_assert(line->vpc > 0 && line->vpc <= spp->pgs_per_line); /* Adjust the position of the victime line in the pq under over-writes */ if (line->pos) { + /* Note that line->vpc will be updated by this call */ pqueue_change_priority(lm->victim_line_pq, line->vpc - 1, line); + } else { + line->vpc--; } - line->vpc--; if (was_full_line) { /* move line: "full" -> "victim" */