diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2017-09-23 22:24:28 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-06-15 13:44:39 -0400 |
commit | 7cc8294252577238eb99bad42c3bc7dd92f4794d (patch) | |
tree | 09a73519b9565693ca699a73ec1a21fd17153350 /src/kernel/pagemgr.C | |
parent | 5090c197292cdd0ec4ad8e416020e5229812cb65 (diff) | |
download | talos-hostboot-7cc8294252577238eb99bad42c3bc7dd92f4794d.tar.gz talos-hostboot-7cc8294252577238eb99bad42c3bc7dd92f4794d.zip |
Debug improvements for exceptions and OOM hangs
There are two main changes in this commit:
1) Forcing an assert if we cannot allocate pages after
10,000 attempts to yield.
2) Adding a backtrace for a lot of exception paths.
Change-Id: I755ada753b78abed56e553f7c669f0f98ae68700
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58224
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: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/kernel/pagemgr.C')
-rw-r--r-- | src/kernel/pagemgr.C | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C index f5c4d406a..42545470a 100644 --- a/src/kernel/pagemgr.C +++ b/src/kernel/pagemgr.C @@ -37,6 +37,7 @@ #include <assert.h> #include <kernel/memstate.H> #include <kernel/bltohbdatamgr.H> +#include <kernel/misc.H> size_t PageManager::cv_coalesce_count = 0; @@ -155,7 +156,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; + size_t l_attempts = 0; while (NULL == page) { page = _syscall1(Systemcalls::MM_ALLOC_PAGES, @@ -165,11 +166,14 @@ 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 + l_attempts++; + if( l_attempts == 10000 ) { - printk("Cannot allocate %ld pages\n", n); + printk( "Cannot allocate %ld pages to %d!\n", + n, task_gettid() ); MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR); + KernelMisc::printkBacktrace(nullptr); + task_crash(); } task_yield(); } |