summaryrefslogtreecommitdiffstats
path: root/src/kernel/heapmgr.C
Commit message (Collapse)AuthorAgeFilesLines
* Automatically include config.hDan Crowell2019-12-061-2/+1
| | | | | | | | | | | | | | | | | | Rather than having to remember to include config.h anywhere we reference a CONFIG variable (and usually forgetting), this adds it to the default compiler flags so that it gets included in every source file we build. Change-Id: I53622ab4d46c55d942e98cae6ec03049fd5b3d08 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87475 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: Zachary Clark <zach@ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Christian R Geddes <crgeddes@us.ibm.com> Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com>
* Support for putting fences around mallocsNick Bofferding2018-11-151-8/+263
| | | | | | | | | | | | | | | | | | | This commit implements a compile time feature (set MALLOC_FENCING to y in the src/lib/HBconfig file) which puts check bytes around each malloc. Whenever an allocation is freed, if the check bytes have changed, the memory manager immediate crashes Hostboot. It also fixes a heap corruption in the SBE get capabilities command. Change-Id: I3df96d5fce43c34d3574c47f3c674076842d90e1 CQ: SW442980 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68214 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: Ilya Smirnov <ismirno@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
* Modify debug framework to be build-independentDan Crowell2018-06-261-1/+32
| | | | | | | | | | | | | | | | | During boot, Hostboot will push key pointers into memory. This allows the debug tools to find the pointers (using a known static memory address) to base memory accesses on. This replaces the existing symbol lookup that we use now. That means we don't need to have the exact symbol file for the build we're debugging against. Change-Id: I4618e15a3dc90acc3a89520a502eb818c1b4258c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56097 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: Daniel M. Crowell <dcrowell@us.ibm.com>
* Enhance heap consistency checkingRichard J. Knight2017-04-101-9/+39
| | | | | | | | | | | | | | | | | | -Add validation to heap allocations, marker used to detect buffer overruns to generate exception when memory segment is freed -Add additional debug to the heap bookkeeping data - owner tid, reserved size and an indicator to say it is an allocated chunk Change-Id: Iae522fc4c6157a32f5689ee1ec5fd9d552123eb4 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37829 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
* Support transition from small to big allocation in reallocNick Bofferding2016-06-061-2/+3
| | | | | | | | | | | | Change-Id: I16cb187d12834c74e8682fb84d26d09b7f98869a CQ: SW354768 Backport: master-p8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25271 Tested-by: Jenkins Server Reviewed-by: Christopher J. Engel <cjengel@us.ibm.com> Tested-by: FSP CI Jenkins Reviewed-by: A. P. Williams III <iawillia@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
* Fix spelling mistakes using codespell.Patrick Williams2015-01-151-3/+5
| | | | | | | | | | | | - See https://github.com/lucasdemarchi/codespell Change-Id: I03e102d1ebb9473b6226fa9b6edb684fa0218a2f Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15031 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: Brian Silver <bsilver@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Change copyright prolog for all files to Apache.Patrick Williams2014-05-211-10/+10
| | | | | | | Change-Id: I5664587b4f889099290ef50d50fa9ce5e580e1eb Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11167 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Clean up beam errors in core.Patrick Williams2014-02-271-1/+1
| | | | | | | | | | Change-Id: I695a38ae88583a052cae19b930eb53171f8fab2b RTC:94993 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9050 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Improve robustness of 'free' flag in HeapMgr.Patrick Williams2014-01-151-12/+12
| | | | | | | | | Change-Id: Iea61e36289410540710ced9bb0098c3fadc4e6a4 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8055 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Fix mailbox memory allocation error on attribute syncDean Sanner2013-06-281-0/+8
| | | | | | | | Change-Id: If156faa95769b70731dc77f7b9801ff3ea743556 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5239 Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Race condition in heap coalesce.Patrick Williams2013-05-151-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the heap coalesce function looked at the "free" flag on the next block to determine if two blocks could be merged together. The coalesce function is ran with all cores synchronized so no one should be modifying the heap, but there is still a subtle race condition. A user task could be in the process of freeing a block, marking it "free" but not actually inserting it onto the queues yet. The coalesce will combine this block together but then when the user task resumes it continues to try to insert it onto the queue. This causes both the larger merged block and the smaller block to be on a free queue and memory corruption when both blocks are used. This is resolved by having a new flag indicating that the block is known to be part of the "coalesce" group and using this in addition to the "free" flag. Only blocks which are actually present on the free queues are considered to be part of the "coalesce" group. Change-Id: If33d15d731d32e07e01104244ebc65daf2295878 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4520 Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Enhance heap corruption detection.Patrick Williams2013-05-011-3/+5
| | | | | | | | Change-Id: I25ec156fe3c9088d2de2254017407dbadd2fac31 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4255 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Improve HeapManager::coalesce.Patrick Williams2013-01-191-76/+119
| | | | | | | | | | | | | | | | | | | The coalesce was causing time issues in VPO. Reduce from an O(n^2) to O(n) algorithm. Results from one particular execution: - Old - 91649004 cycles for 7471 chunks - New - 02668146 cycles for 7676 chunks <3% cycle time of original algorithm. Change-Id: I7145c6b430dccdb3f08d186a1ee5ea2f86aa3f81 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2942 Tested-by: Jenkins Server Reviewed-by: Van H. Lee <vanlee@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Tool to display memory statisticsDoug Gilbert2012-01-121-28/+27
| | | | | | | Change-Id: Iaac392b9f4287ba888e454532c4061d6a14c6e5c Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/593 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
* BEAM warning fixes.Patrick Williams2011-10-271-9/+9
| | | | | | | | Change-Id: Iada5e8b69c7919d2b59febd861450abeb7c45287 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/451 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
* new HEAP manager to reduce fragmentationDoug Gilbert2011-10-251-35/+459
| | | | | | | | Change-Id: Ibe725a43e6366d9113ec99df1cc6aafa7bbb770e Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/431 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
* Centralizing a few of the memory-related constants to avoid someDan Crowell2011-09-141-1/+1
| | | | | | | | | | | | redundancies and also to have a single place to update the memory map if needed. See Task 3507. Change-Id: I8f2d632983abe6d6798784e975cd93057018594b Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/330 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
* Add copyright headers to all source files.Patrick Williams2011-08-241-0/+22
| | | | | | | Change-Id: I205f2409e56032cfc0aaf01d7e26d357f0b86373 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/277 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Tested-by: Jenkins Server
* VMM Improvements.Patrick Williams2011-07-201-1/+2
| | | | | | | | | | | - Segment Manager - Base / Device Segments - Block for Base image. Change-Id: Ic0c058e5c5b210ec1c48d30f6ed9f9837d74a3c8 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/193 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
* Enable -Wall and fix warnings.Patrick Williams2010-08-191-2/+2
|
* malloc / free supportPatrick Williams2010-05-211-1/+6
|
* Add heap manager for allocations up to 2040 bytesPatrick Williams2010-05-211-0/+83
OpenPOWER on IntegriCloud