PPL Logo

vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE > Class Template Reference

class vmNRUPageReplacementPolicy This class provides the functionality of not-recently-used page replacement policy. More...

#include <msa-DistPageMgr.h>

Inheritance diagram for vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >:

Inheritance graph
[legend]
Collaboration diagram for vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >:

Collaboration graph
[legend]

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

Detailed Description

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
class vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >

class vmNRUPageReplacementPolicy This class provides the functionality of not-recently-used page replacement policy.

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.


Member Typedef Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.


Member Enumeration Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
anonymous enum [protected]

Enumerator:
K 

Definition at line 336 of file msa-DistPageMgr.h.


Constructor & Destructor Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::vmNRUReplacementPolicy ( unsigned int  nPages_,
const std::vector< ENTRY_TYPE * > &  pageTable_,
const std::vector< pageState_t * > &  pageState_ 
) [inline]

Definition at line 348 of file msa-DistPageMgr.h.

References MSA_INVALID_PAGE_NO.


Member Function Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
bool vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::recentlyUsed ( unsigned int  page  )  [inline, protected]

Definition at line 342 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.


Field Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::nPages [protected]

Definition at line 332 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
const std::vector<ENTRY_TYPE *>& vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageTable [protected]

Definition at line 333 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
const std::vector<pageState_t *>& vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageState [protected]

Definition at line 335 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::last[K] [protected]

Definition at line 337 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::Klast [protected]

Definition at line 338 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
unsigned int vmNRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::victim [protected]

Definition at line 340 of file msa-DistPageMgr.h.


The documentation for this class was generated from the following file:

Generated on Mon Sep 21 08:31:42 2020 for Charm++ by  doxygen 1.5.5