From f2dd720826afaa6669feb9baed6196c960383899 Mon Sep 17 00:00:00 2001 From: Nick Bofferding Date: Sat, 28 Feb 2015 01:26:21 -0600 Subject: Reduce memory fragementation in large allocations - Free excess allocation pages in reverse order Change-Id: I4c5f2909275e2d3dc71b0806fbf177a101b47292 CQ: FW633822 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16066 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell Reviewed-by: A. Patrick Williams III --- src/include/kernel/pagemgr.H | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/kernel/pagemgr.H b/src/include/kernel/pagemgr.H index dcd14c456..95bb2fb65 100644 --- a/src/include/kernel/pagemgr.H +++ b/src/include/kernel/pagemgr.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2014 */ +/* Contributors Listed Below - COPYRIGHT 2010,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -81,8 +83,13 @@ class PageManagerCore * Return page allocations to the page manager * @param[in] i_page, pointer to the allocation * @param[in] i_pageCount, the number of pages in the allocation + * @param[in] i_overAllocated, whether pages to free are the being + * returned because the intial allocation was larger than needed */ - void freePage( void * i_page, size_t i_pageCount ); + void freePage( + void* i_page, + size_t i_pageCount, + bool i_overAllocated = false ); /** * Coalesce pages in the page manager (defrag) -- cgit v1.2.3