summaryrefslogtreecommitdiffstats
path: root/src/kernel/cpumgr.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-07-13 21:28:37 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-16 14:00:44 -0500
commit1535c27d4a7a970f3e14ace7cb980ae06820e9ec (patch)
tree5cc9f264592f90f56c40bc12a50d1c6a6261b89a /src/kernel/cpumgr.C
parent7f482f9ad23bd7689fdee5982ad91f8506b2dfb8 (diff)
downloadtalos-hostboot-1535c27d4a7a970f3e14ace7cb980ae06820e9ec.tar.gz
talos-hostboot-1535c27d4a7a970f3e14ace7cb980ae06820e9ec.zip
Improve user-space page allocator.
* Allow page allocation system call to force coalesce if a contiguous block is unavailable. [long-term enhancement] * Workaround lack of large contiguous memory for PageTable test-cases, which require 256K, by allocating a VMM block. This should be removed when story 43401 is implemented. [short-term workaround] Change-Id: Idddb30eaa3aeac52d56b82a70355095f31d4a0cd Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1369 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/cpumgr.C')
-rw-r--r--src/kernel/cpumgr.C17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index 2a5c2edcc..4fdc8fde9 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -43,6 +43,7 @@ uint64_t CpuManager::cv_shutdown_status = 0;
Barrier CpuManager::cv_barrier;
bool CpuManager::cv_defrag = false;
size_t CpuManager::cv_cpuCount = 0;
+bool CpuManager::cv_forcedMemPeriodic = false;
InteractiveDebug CpuManager::cv_interactive_debug;
CpuManager::CpuManager()
@@ -188,11 +189,16 @@ void CpuManager::executePeriodics(cpu_t * i_cpu)
cv_interactive_debug.startDebugTask();
}
+ bool forceMemoryPeriodic = __sync_fetch_and_and(&cv_forcedMemPeriodic,
+ false);
+
++(i_cpu->periodic_count);
- if(0 == (i_cpu->periodic_count % CPU_PERIODIC_CHECK_MEMORY))
+ if((0 == (i_cpu->periodic_count % CPU_PERIODIC_CHECK_MEMORY)) ||
+ (forceMemoryPeriodic))
{
uint64_t pcntAvail = PageManager::queryAvail();
- if(pcntAvail < PageManager::LOWMEM_NORM_LIMIT)
+ if((pcntAvail < PageManager::LOWMEM_NORM_LIMIT) ||
+ (forceMemoryPeriodic))
{
VmmManager::flushPageTable();
++(i_cpu->periodic_count); // prevent another flush below
@@ -210,7 +216,8 @@ void CpuManager::executePeriodics(cpu_t * i_cpu)
{
VmmManager::flushPageTable();
}
- if(0 == (i_cpu->periodic_count % CPU_PERIODIC_DEFRAG))
+ if((0 == (i_cpu->periodic_count % CPU_PERIODIC_DEFRAG)) ||
+ (forceMemoryPeriodic))
{
// set up barrier based on # cpus cv_barrier;
// TODO whatif other cpus become active?
@@ -240,3 +247,7 @@ void CpuManager::executePeriodics(cpu_t * i_cpu)
}
}
+void CpuManager::forceMemoryPeriodic()
+{
+ cv_forcedMemPeriodic = true;
+}
OpenPOWER on IntegriCloud