diff options
author | Bill Hoffa <wghoffa@us.ibm.com> | 2018-02-21 08:22:06 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-02-23 10:07:15 -0500 |
commit | 014e0ae7136ccd47412916acdbcbfaa2ceeac603 (patch) | |
tree | 83ad119b2e602e06f4ca7c33a48272177dbbbbfc /src | |
parent | 2674db2b85b470b1dd944835f102cbea4ce8447c (diff) | |
download | talos-hostboot-014e0ae7136ccd47412916acdbcbfaa2ceeac603.tar.gz talos-hostboot-014e0ae7136ccd47412916acdbcbfaa2ceeac603.zip |
Add Kernel Debug Trace for Out of Memory condition
- Display size of page requested if requested memory
doesn't become available
Change-Id: I5b101ce6650cdc155be276c5d00f95bc35a0ff90
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54491
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>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/pagemgr.C | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C index bdc8244f2..978c6b9d2 100644 --- a/src/kernel/pagemgr.C +++ b/src/kernel/pagemgr.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2010,2017 */ +/* Contributors Listed Below - COPYRIGHT 2010,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -155,6 +155,7 @@ void* PageManager::allocatePage(size_t n, bool userspace) // In non-kernel mode, make a system-call to allocate in kernel-mode. if (!KernelMisc::in_kernel_mode()) { + size_t attempts = 0; while (NULL == page) { page = _syscall1(Systemcalls::MM_ALLOC_PAGES, @@ -164,6 +165,12 @@ void* PageManager::allocatePage(size_t n, bool userspace) // will eventually free up (ex. VMM flushes). if (NULL == page) { + attempts++; + if( attempts == 10000 ) //arbitrarily huge number + { + printk("Cannot allocate %ld pages\n", n); + MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR); + } task_yield(); } } |