summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2012-10-01 09:38:17 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-03 11:39:10 -0500
commit73a46b3598a525c559b23892d2da2d620a26a34b (patch)
treebe7e19c117be5b24f2af04df91958b97a38947a5 /src/kernel
parentfe032437b7b70589847890c447c99c219a466e54 (diff)
downloadtalos-hostboot-73a46b3598a525c559b23892d2da2d620a26a34b.tar.gz
talos-hostboot-73a46b3598a525c559b23892d2da2d620a26a34b.zip
Fix incorrect page count in PageManager
Change-Id: Ib234df5b96275b0174994712d5b250681625f148 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1928 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/pagemgr.C56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C
index 60db55e12..4415cb81d 100644
--- a/src/kernel/pagemgr.C
+++ b/src/kernel/pagemgr.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/kernel/pagemgr.C $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2010-2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/kernel/pagemgr.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2010,2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#include <limits.h>
#include <kernel/pagemgr.H>
#include <util/singleton.H>
@@ -249,11 +248,14 @@ void* PageManager::_allocatePage(size_t n, bool userspace)
kassert(false);
}
- // Update statistics.
- __sync_sub_and_fetch(&iv_pagesAvail, n);
- if(iv_pagesAvail < cv_low_page_count)
+ // Update statistics (only if we actually found a page).
+ if( NULL != page )
{
- cv_low_page_count = iv_pagesAvail;
+ __sync_sub_and_fetch(&iv_pagesAvail, n);
+ if(iv_pagesAvail < cv_low_page_count)
+ {
+ cv_low_page_count = iv_pagesAvail;
+ }
}
return page;
OpenPOWER on IntegriCloud