diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2012-10-01 09:38:17 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-10-03 11:39:10 -0500 |
commit | 73a46b3598a525c559b23892d2da2d620a26a34b (patch) | |
tree | be7e19c117be5b24f2af04df91958b97a38947a5 /src/kernel | |
parent | fe032437b7b70589847890c447c99c219a466e54 (diff) | |
download | talos-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.C | 56 |
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; |