#include <msa-DistPageMgr.h>
Public Member Functions | |
vmNRUReplacementPolicy (unsigned int nPages_, const std::vector< ENTRY_TYPE * > &pageTable_, const std::vector< pageState_t * > &pageState_) | |
void | pageAccessed (unsigned int page) |
Note that a page was just accessed. | |
unsigned int | selectPage () |
Ask for the index of a page to discard. | |
Protected Types | |
enum | { K = 5 } |
typedef MSA_Page_StateT < ENTRY_TYPE, ENTRIES_PER_PAGE > | pageState_t |
Protected Member Functions | |
bool | recentlyUsed (unsigned int page) |
Protected Attributes | |
unsigned int | nPages |
const std::vector< ENTRY_TYPE * > & | pageTable |
const std::vector< pageState_t * > & | pageState |
unsigned int | last [K] |
unsigned int | Klast |
unsigned int | victim |
It needs to be notified when a page is accessed using the pageAccessed() function and a page can be selected for replacement using the selectPage() function.
"not-recently-used" could replace any page that has not been used in the last K accesses; that is, it's a memory-limited version of LRU.
pageAccessed is O(1). selectPage best-case is O(K) (if we immediately find a doomed page); worst-case is O(K n) (if there are no doomed pages).
Definition at line 329 of file msa-DistPageMgr.h.
typedef MSA_Page_StateT<ENTRY_TYPE, ENTRIES_PER_PAGE> vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageState_t [protected] |
Definition at line 334 of file msa-DistPageMgr.h.
anonymous enum [protected] |
vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::vmNRUReplacementPolicy | ( | unsigned int | nPages_, | |
const std::vector< ENTRY_TYPE * > & | pageTable_, | |||
const std::vector< pageState_t * > & | pageState_ | |||
) | [inline] |
bool vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::recentlyUsed | ( | unsigned int | page | ) | [inline, protected] |
Definition at line 342 of file msa-DistPageMgr.h.
void vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageAccessed | ( | unsigned int | page | ) | [inline, virtual] |
Note that a page was just accessed.
Implements MSA_PageReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >.
Definition at line 356 of file msa-DistPageMgr.h.
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::selectPage | ( | ) | [inline, virtual] |
Ask for the index of a page to discard.
Implements MSA_PageReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >.
Definition at line 364 of file msa-DistPageMgr.h.
References MSA_INVALID_PAGE_NO.
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::nPages [protected] |
Definition at line 332 of file msa-DistPageMgr.h.
const std::vector<ENTRY_TYPE *>& vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageTable [protected] |
Definition at line 333 of file msa-DistPageMgr.h.
const std::vector<pageState_t *>& vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageState [protected] |
Definition at line 335 of file msa-DistPageMgr.h.
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::last[K] [protected] |
Definition at line 337 of file msa-DistPageMgr.h.
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::Klast [protected] |
Definition at line 338 of file msa-DistPageMgr.h.
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::victim [protected] |
Definition at line 340 of file msa-DistPageMgr.h.