diff options
| author | Dan Crowell <dcrowell@us.ibm.com> | 2011-08-08 09:36:04 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2011-09-06 12:18:36 -0500 |
| commit | f093b902e49a0ee46d232cd196ec48f88f801735 (patch) | |
| tree | c6d540acf79d21e21c936a381968e4158fee29c7 /src/include/kernel/spte.H | |
| parent | dcf7c7f2c3be17df41e3cc483dbec6f085b05353 (diff) | |
| download | blackbird-hostboot-f093b902e49a0ee46d232cd196ec48f88f801735.tar.gz blackbird-hostboot-f093b902e49a0ee46d232cd196ec48f88f801735.zip | |
Adding a basic interface and implementation to the Segment/Block
path to update the LRU statistics when the PageTableManager code
clears the reference bit. This is not meant to be a complete
implementation (different Task is open for that).
This is Task 3400.
Change-Id: If67efd16ead6f68a74f5f5a698013c1b852864d9
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/231
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/kernel/spte.H')
| -rw-r--r-- | src/include/kernel/spte.H | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/include/kernel/spte.H b/src/include/kernel/spte.H index 1a284d6e7..abd81dff3 100644 --- a/src/include/kernel/spte.H +++ b/src/include/kernel/spte.H @@ -66,8 +66,11 @@ class ShadowPTE /** Allocate from a zero'd page. */ uint32_t allocate_from_zero:1; + /** LRU value - lower means it was accessed more recently. */ + uint32_t last_access:3; + /** Reserved for future use. */ - uint32_t reserved:6; + uint32_t reserved:3; } PACKED; }; @@ -106,10 +109,34 @@ class ShadowPTE bool isDirty() const { return dirty; }; /** Set dirty bit. */ void setDirty(bool i_dirty) { dirty = i_dirty; }; + /** Get allocate-from-zero bit. */ bool isAllocateFromZero() const { return allocate_from_zero; }; /** Set allocate-from-zero bit. */ void setAllocateFromZero(bool i_zero) { allocate_from_zero = i_zero; }; + + /** Get last_acces bits. */ + uint8_t getLRU() const { return last_access; }; + /** Increment the LRU bits. */ + void incLRU() { + if( last_access < 0b111 ) + { + last_access++; + } + }; + /** Decrement the LRU bits. */ + void decLRU() { + if( last_access > 0 ) + { + last_access--; + } + }; + /** Zero out the LRU bits. */ + void zeroLRU() { + last_access = 0; + }; + + }; #endif |

