History log of /fuchsia/zircon/kernel/lib/heap/cmpctmalloc/cmpctmalloc.c
Revision Date Author Comments
# 4dcde592 04-Sep-2018 Nick Maniscalco <maniscalco@google.com>

[kernel][heap] Print cached free block size in heap info

When printing the heap info, include the size of the cached free block
(if present). Otherwise, the results can be misleading.

Test: "k heap info"

Change-Id: Ia7e04c20619c75176672b5d4c6df738b1eb9f04b


# f4ba9056 22-May-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][malloc] also cap the max allocation size for memalign

We already capped the max allocation size for malloc, do the same thing
for memalign.

Change-Id: I0bf479e059ae6ba7b59fda278cc7a7a91b66b858


# f19625d8 09-May-2018 Nick Maniscalco <maniscalco@google.com>

[kernel] Fix heap accounting when growing heap

Tested by allocating 50MB in 1KB chunks, freeing it all, and checking
heap size via "k heap info".

ZX-2134 #done

Change-Id: Id3260ad3bc8173e523e1a09cb726b72cbf7073e7


# f93b9b4d 23-Feb-2018 Carlos Pizano <cpu@google.com>

[zircon] remove large_alloc from cmpctmalloc

Large heap allocations (bigger than 4MB) should not be requested
by kernel so by removing this path we fix two bugs

"memalign for an 8 MB region with 4KB alignment, the system sometimes panic"
and
"malloc(~(size_t)0) succeeds in the kernel's implementation of malloc"

Also ifdef out the tests for target.

Change-Id: I4317c0283453e070f1796c88dd87586294af2b73


# 5fb8e9ed 23-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move vm.h to the new spot and remove some unused code

Change-Id: I69f1b804fb95dd44e3e0619943e8809519aa82ca


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# adf55279 30-Aug-2017 Dave Bort <dbort@google.com>

[cmpctmalloc] Don't always free OS allocations

Avoids PMM churn when alloc/free behavior is right on the edge of available
memory in the heap. Without this, we'd often request 10M from the PMM to
satisfy a malloc(NNNN), then immediately return that 10M in free(). Running
fs-test hits this case a lot.

Change-Id: I107edd554a46c918e3bc4939c28495b0bb0ed774


# 7407ed62 30-Aug-2017 Dave Bort <dbort@google.com>

[cmpctmalloc] Overview docs and minor refactoring

Change-Id: Ia2635882050fcb9cdb06c5c7d4782ca3857167c8


# 98809c46 23-Aug-2017 Dave Bort <dbort@google.com>

[cmpctmalloc] clang-format; no functional changes

In preparation for some upcoming work and documentation

Change-Id: Ie3bf964a5485defcd7238cde8be2ecb6c448d5f8


# afe554d0 06-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] objectify the mmu layer by adding a simple wrapper object

This just adds a wrapper object around the arch_mmu routines and
switches the high level api to an object oriented model. Subsequent
changes will remove the wrapper and have the two arches implement the
objects directly.

Change-Id: I5ce0d28db5612f4fbc9e0c87d2f6b22dcd09a3f1


# afa9d2b6 15-Jun-2017 George Kulakowski <kulakowski@google.com>

[kernel][lib] Use the new MX_OK and MX_ERR_* names

Change-Id: I436bb0728838729bef6e20a6db0e8ce6a96b5534


# 485df13a 07-Jun-2017 Dave Bort <dbort@google.com>

[kernel][heap] Add heap_get_info() for total/free size

For MG-819: "Tool to print kernel memory usage"

Change-Id: I503368f42202e1c2a759b78c003ce3ffa12ab4fe


# 3d9a9695 26-May-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][heap] general heap wrapper improvements

-Move the heap wrapper code to cpp
-Roll the heap page allocator into heap_wrapper.cpp
-Remove the compile time heap selection logic
-Remove miniheap

Change-Id: Id6d85b68ae02d410e91e95431ecb7b56d16a6f0d


# 4eb0b3b2 17-Mar-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][heap] Strengthen the heap debug features

This adds checking of free-fill on allocation. It should help detect
use-after-free bugs (and was instrumental in identifying the recent
futex use-after-free).

Change-Id: Ic915eb344bf97ff8fe4c55c48ad9c4b7f56b5978


# 4b81159d 03-Mar-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][heap] add ability to dump the heap info at panic time

Should be helpful to try to determine what is going on if the heap has
exploded.

Change-Id: If22f400ae7031664af3b16786bbb95185aa90189


# 4dbba8ea 19-Jan-2017 James Robinson <jamesr@google.com>

[kernel] Add thread safety annotations for kernel mutex_t and cond_t

Change-Id: I651a0cf7dd400459de465d6a84f30a06052e4426


# 4e11ce5b 21-Nov-2016 Travis Geiselbrecht <travisg@google.com>

[kernel][heap][cmpctmalloc] properly account for size changes if the grow routine fails

Previously would always add to the heap size even if asking for more pages fails.

Change-Id: I3b4131187376aa15c2d394425323467db85f0185


# ee3d6ee6 31-Oct-2016 Travis Geiselbrecht <travisg@google.com>

[kernel] remove the no-vm path

Remove the no-vm build, which hasn't worked for quite some time. Cleans up
some clutter in some of the boot code.

Change-Id: Ia11c531c19d167538838a47f92e5d5c38d8fec71


# f8aaa788 29-Sep-2016 Roland McGrath <mcgrathr@google.com>

[kernel] Use compiler's types and values for <stdint.h>

The compiler provides predefined macros for what it thinks all
the types should be. Just do what the compiler says rather than
second-guessing. However, the arm-eabi GCC target uses 'long' for
'int32_t' et al, which is unlike all other targets (including
arm-linux), so override the compiler's choices for those.

GCC doesn't give direct assistance in getting the <inttypes.h> PRI*
macros right, though Clang, does. So we have conditionals for that,
defining the same macros that Clang predefines.

This requires cleaning up lots of printf-style formats that were
sloppily using "whatever works", to use the proper <inttypes.h>
macro for the types being used. Also some declarations of functions
and typedefs using 'long long' are changed to use 'int64_t', etc.

Change-Id: I35e303510d06f48548b958f844790a3acfbf2eea


# b856ad59 21-Sep-2016 Brian Swetland <swetland@google.com>

[kernel][malloc][debug] only enable aggressive debug on DEBUGLEVEL > 2

This brings message pipe read/write performance from 60us/250us or
thereabouts to under 10us.

Change-Id: Iccee6659385db4cf08f98224aded4943bc08ca8f


# d77ecc79 26-Aug-2016 John Grossman <johngro@google.com>

[assert] STATIC_ASSERT --> static_assert

Get rid of STATIC_ASSERT. Instead, use the C/C++11 standard
static_assert.

Change-Id: I5f18e3534afc0838715174c6fc0fb7d169b022a7


# 8ae59dcf 27-Jul-2016 Carlos Pizano <cpu@google.com>

[kernel][heap] AllocChecker tests

And a small fix to cmpctmalloc:

If you ask for a large (1GB or more) allocation, the |heap_grow|
result was being ignored, caused a crash in |create_allocation_header|

Change-Id: I0d7e62fbd876922574438f3ea0753c8aef7fe551


# 53b9e1c8 15-Jun-2016 The Fuchsia Authors <authors@fuchsia.local>

[magenta] Initial commit