summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf
diff options
context:
space:
mode:
authorJay Azurin <jmazurin@us.ibm.com>2015-08-28 12:53:22 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-09-04 18:10:13 -0500
commitaaf724e9f06ac6013f97bb967aae6c4510b0a1da (patch)
tree58561d4ee3e7e715f453a7462c1aa8bfa1f4902d /src/usr/hwpf
parent63ffc550f12b78679e66813e73ea995ca84551b9 (diff)
downloadtalos-hostboot-aaf724e9f06ac6013f97bb967aae6c4510b0a1da.tar.gz
talos-hostboot-aaf724e9f06ac6013f97bb967aae6c4510b0a1da.zip
Workaround for fapiMalloc fragmentation issue
Added a macro that returns the next highest power of 2 number of pages for a given buffer. Implemented fapiPlatMalloc() so that it calls the macro for buffers larger than 1 page size. This can prevent excessive fragmentation when allocating very large buffers. CQ:SW317751 Change-Id: I8eaef95ba4381026377a1eab0fe620b2954c8230 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20255 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: William H. Schwartz <whs@us.ibm.com> Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf')
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpdRingFuncs.C2
-rw-r--r--src/usr/hwpf/plat/fapiPlatUtil.C15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpdRingFuncs.C b/src/usr/hwpf/hwp/mvpd_accessors/mvpdRingFuncs.C
index e54b0f602..3a532a1dc 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/mvpdRingFuncs.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpdRingFuncs.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C
index 64df4d33a..d03b6705b 100644
--- a/src/usr/hwpf/plat/fapiPlatUtil.C
+++ b/src/usr/hwpf/plat/fapiPlatUtil.C
@@ -40,7 +40,8 @@
#include <initservice/initsvcbreakpoint.H>
#include <errl/errlentry.H>
#include <initservice/initserviceif.H>
-
+#include <util/align.H>
+#include <fapiPlatUtil.H>
#ifdef __HOSTBOOT_RUNTIME
#include <runtime/interface.h>
@@ -325,3 +326,15 @@ fapi::ReturnCode fapiSpecialWakeup(const fapi::Target & i_target,
}
}
+
+//******************************************************************************
+// fapiPlatMalloc
+//******************************************************************************
+void* fapiPlatMalloc(size_t s)
+{
+ if (s > PAGE_SIZE)
+ {
+ s = ALIGN_TO_NEXT_POWER_OF_TWO_PAGES(s);
+ }
+ return malloc(s);
+}
OpenPOWER on IntegriCloud