summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2018-06-02 07:04:17 -0500
committerNicholas E. Bofferding <bofferdn@us.ibm.com>2018-06-04 11:38:49 -0400
commitf9aa8f06bbd8250f63725080e189ce4719fd1253 (patch)
tree18df4b0a1129c1b36cf7c4519571832fa7e145c3 /src/kernel
parent6359b6a6e881a569c8588b6f2701a71e479fb5ae (diff)
downloadtalos-hostboot-f9aa8f06bbd8250f63725080e189ce4719fd1253.tar.gz
talos-hostboot-f9aa8f06bbd8250f63725080e189ce4719fd1253.zip
Memory Management: Fix coalesce to track holes in the page management
The heap memory coalesce algorithm previously did not account for the right page start address and the hole carved out for the page table. This change fixes both issues Change-Id: I730b546eb1966051c1d5dd8459d76a7943234bea Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59813 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/pagemgr.C21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C
index 978c6b9d2..f5c4d406a 100644
--- a/src/kernel/pagemgr.C
+++ b/src/kernel/pagemgr.C
@@ -398,9 +398,24 @@ void PageManagerCore::coalesce( void )
{
// p needs to be the even buddy to prevent merging of wrong block.
// To determine this, get the index of the block as if the whole
- // page memory space were blocks of this size.
- uint64_t p_idx = (reinterpret_cast<uint64_t>(p) - firstPageAddr())/
- ((1 << bucket)*PAGESIZE);
+ // page memory space were blocks of this size. Note: have to
+ // take into account the page manager "hole" in the middle of the
+ // space
+ uint64_t p_idx = 0;
+ if(reinterpret_cast<uint64_t>(p) < VmmManager::pageTableOffset())
+ {
+ p_idx = ( reinterpret_cast<uint64_t>(p)
+ - VmmManager::endPreservedOffset())/
+ ((1 << bucket)*PAGESIZE);
+ }
+ else
+ {
+ p_idx = ( reinterpret_cast<uint64_t>(p)
+ - ( VmmManager::pageTableOffset()
+ + VmmManager::PTSIZE) )/
+ ((1 << bucket)*PAGESIZE);
+ }
+
if(0 != (p_idx % 2)) // odd index
{
iv_heap[bucket].push(p); // can't merge
OpenPOWER on IntegriCloud