Cache: Fix the LRU policy for classic memory hierarchy
[gem5.git] / src / mem / cache / tags / lru.cc
index babcedc89b1c8ba8e54e13c36496d1cfc94fb2e2..c73f557b9dcef054bda0ab213a21ffda81ebf3ab 100644 (file)
@@ -213,6 +213,10 @@ LRU::invalidateBlk(BlkType *blk)
         blk->status = 0;
         blk->isTouched = false;
         blk->clearLoadLocks();
+
+        // should be evicted before valid blocks
+        unsigned set = blk->set;
+        sets[set].moveToTail(blk);
     }
 }