summaryrefslogtreecommitdiff
path: root/kern/slab.h
AgeCommit message (Collapse)Author
2014-01-09kern: align kmem_cache objects using __cacheline_alignedJustus Winter
* kern/slab.h (struct kmem_cache): Align kmem_cache objects using __cacheline_aligned.
2014-01-06kern: optimize the layout of struct kmem_cacheJustus Winter
* kern/slab.h (struct kmem_cache): Reorder the fields so that all hot fields are within the first cache line.
2014-01-05kern: explain the significance of the chosen lengthJustus Winter
* kern/slab.h (KMEM_CACHE_NAME_SIZE): Explain the significance of the chosen length.
2014-01-03kern: make struct kmem_cache fit into two cache linesJustus Winter
Previously, the size of struct kmem_cache was 136 bytes, just eight bytes larger than 128 bytes, which is typically two cache lines on today's CPUs. By reducing the size of the name field which holds a human-readable description by eight bytes to 24 bytes, the struct kmem_cache can be made fit into two cache lines. This change should not affect the usefulness of this field. For reference, the length of the largest hard-coded name is 17. * kern/slab.h (KMEM_CACHE_NAME_SIZE): Define to 24.
2013-04-21Rework slab lists handlingRichard Braun
Don't enforce strong ordering of partial slabs. Separating partial slabs from free slabs is already effective against fragmentation, and sorting would sometimes cause pathological scalability issues. In addition, store new slabs (whether free or partial) in LIFO order for better cache usage. * kern/slab.c (kmem_cache_grow): Insert new slab at the head of the slabs list. (kmem_cache_alloc_from_slab): Likewise. In addition, don't sort partial slabs. (kmem_cache_free_to_slab): Likewise. * kern/slab.h: Remove comment about partial slabs sorting.
2013-01-08Add function to dump a raw summary of the slab allocator stateRichard Braun
The purpose of this function is to allow kernel code to display the state of the slab caches in situations where the host_slab_info RPC wouldn't be available, e.g. before a panic. * kern/slab.c (slab_info): New function. * kern/slab.h: Add declaration for slab_info.
2012-04-22Fix copyright assignmentRichard Braun
Maksym and I have assigned copyright to the Free Software Foundation. In addition, restore the original upstream copyrights for correctness. * kern/list.h: Fix copyright assignment. * kern/rbtree.c: Likewise. * kern/rbtree.h: Likewise. * kern/rbtree_i.h: Likewise. * kern/slab.c: Likewise. * kern/slab.h: Likewise.
2011-12-17Import the slab allocatorRichard Braun
As it is intended to completely replace the zone allocator, remove it on the way. So long to the venerable code ! * Makefrag.am (libkernel_a_SOURCES): Add kern/slab.{c,h}, remove kern/kalloc.c and kern/zalloc.{c,h}. * configfrag.ac (SLAB_VERIFY, SLAB_USE_CPU_POOLS): Add defines. * i386/Makefrag.am (libkernel_a_SOURCES): Remove i386/i386/zalloc.h. * i386/configfrag.ac (CPU_L1_SHIFT): Remove define. * include/mach_debug/slab_info.h: New file. * kern/slab.c: Likewise. * kern/slab.h: Likewise. * i386/i386/zalloc.h: Remove file. * include/mach_debug/zone_info.h: Likewise. * kern/kalloc.c: Likewise. * kern/zalloc.c: Likewise. * kern/zalloc.h: Likewise.