kernel-hacking-2024-linux-s.../mm
Matt Mackall 10cef60295 [PATCH] slob: introduce the SLOB allocator
configurable replacement for slab allocator

This adds a CONFIG_SLAB option under CONFIG_EMBEDDED.  When CONFIG_SLAB is
disabled, the kernel falls back to using the 'SLOB' allocator.

SLOB is a traditional K&R/UNIX allocator with a SLAB emulation layer,
similar to the original Linux kmalloc allocator that SLAB replaced.  It's
signicantly smaller code and is more memory efficient.  But like all
similar allocators, it scales poorly and suffers from fragmentation more
than SLAB, so it's only appropriate for small systems.

It's been tested extensively in the Linux-tiny tree.  I've also
stress-tested it with make -j 8 compiles on a 3G SMP+PREEMPT box (not
recommended).

Here's a comparison for otherwise identical builds, showing SLOB saving
nearly half a megabyte of RAM:

$ size vmlinux*
   text    data     bss     dec     hex filename
3336372  529360  190812 4056544  3de5e0 vmlinux-slab
3323208  527948  190684 4041840  3dac70 vmlinux-slob

$ size mm/{slab,slob}.o
   text    data     bss     dec     hex filename
  13221     752      48   14021    36c5 mm/slab.o
   1896      52       8    1956     7a4 mm/slob.o

/proc/meminfo:
                  SLAB          SLOB      delta
MemTotal:        27964 kB      27980 kB     +16 kB
MemFree:         24596 kB      25092 kB    +496 kB
Buffers:            36 kB         36 kB       0 kB
Cached:           1188 kB       1188 kB       0 kB
SwapCached:          0 kB          0 kB       0 kB
Active:            608 kB        600 kB      -8 kB
Inactive:          808 kB        812 kB      +4 kB
HighTotal:           0 kB          0 kB       0 kB
HighFree:            0 kB          0 kB       0 kB
LowTotal:        27964 kB      27980 kB     +16 kB
LowFree:         24596 kB      25092 kB    +496 kB
SwapTotal:           0 kB          0 kB       0 kB
SwapFree:            0 kB          0 kB       0 kB
Dirty:               4 kB         12 kB      +8 kB
Writeback:           0 kB          0 kB       0 kB
Mapped:            560 kB        556 kB      -4 kB
Slab:             1756 kB          0 kB   -1756 kB
CommitLimit:     13980 kB      13988 kB      +8 kB
Committed_AS:     4208 kB       4208 kB       0 kB
PageTables:         28 kB         28 kB       0 kB
VmallocTotal:  1007312 kB    1007312 kB       0 kB
VmallocUsed:        48 kB         48 kB       0 kB
VmallocChunk:  1007264 kB    1007264 kB       0 kB

(this work has been sponsored in part by CELF)

From: Ingo Molnar <mingo@elte.hu>

   Fix 32-bitness bugs in mm/slob.c.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:41 -08:00
..
bootmem.c [PATCH] FRV: Clean up bootmem allocator's page freeing algorithm 2006-01-06 08:33:26 -08:00
fadvise.c [PATCH] xip: madvice/fadvice: execute in place 2005-06-24 00:06:42 -07:00
filemap.c [PATCH] find_lock_page(): call __lock_page() directly. 2006-01-06 08:33:26 -08:00
filemap.h
filemap_xip.c [PATCH] mm: rmap with inner ptlock 2005-10-29 21:40:41 -07:00
fremap.c VM: add common helper function to create the page tables 2005-11-29 14:03:14 -08:00
highmem.c [PATCH] gfp_t: the rest 2005-10-28 08:16:51 -07:00
hugetlb.c [PATCH] mm: make hugepages obey cpusets. 2006-01-08 20:12:43 -08:00
internal.h [PATCH] FRV: Clean up bootmem allocator's page freeing algorithm 2006-01-06 08:33:26 -08:00
Kconfig [PATCH] Swap Migration V5: Add CONFIG_MIGRATION for page migration support 2006-01-08 20:12:41 -08:00
madvise.c [PATCH] madvise(MADV_REMOVE): remove pages from tmpfs shm backing store 2006-01-06 08:33:22 -08:00
Makefile [PATCH] slob: introduce the SLOB allocator 2006-01-08 20:13:41 -08:00
memory.c [PATCH] mm: pfault optimisation 2006-01-06 08:33:27 -08:00
memory_hotplug.c [PATCH] memhotplug: __add_section remove unused pgdat definition 2006-01-06 08:33:21 -08:00
mempolicy.c [PATCH] Move page migration related functions near do_migrate_pages() 2006-01-08 20:12:44 -08:00
mempool.c [PATCH] gfp_t: mm/* (easy parts) 2005-10-28 08:16:47 -07:00
mincore.c
mlock.c
mmap.c Make sure we copy pages inserted with "vm_insert_page()" on fork 2005-12-16 10:21:23 -08:00
mprotect.c [PATCH] unpaged: private write VM_RESERVED 2005-11-22 09:13:42 -08:00
mremap.c Make sure we copy pages inserted with "vm_insert_page()" on fork 2005-12-16 10:21:23 -08:00
msync.c mm: re-architect the VM_UNPAGED logic 2005-11-28 14:34:23 -08:00
nommu.c [PATCH] NOMMU: Make SYSV IPC SHM use ramfs facilities on NOMMU 2006-01-06 08:33:32 -08:00
oom_kill.c [PATCH] Optimise oom kill of current task 2006-01-08 20:12:45 -08:00
page-writeback.c identify multipage ->writepages() calls 2006-01-06 14:58:38 -05:00
page_alloc.c [PATCH] mm: free_pages opt 2006-01-08 20:12:40 -08:00
page_io.c [PATCH] mm: split page table lock 2005-10-29 21:40:42 -07:00
pdflush.c [PATCH] Swap Migration V5: PF_SWAPWRITE to allow writing to swap 2006-01-08 20:12:41 -08:00
prio_tree.c
readahead.c [PATCH] add AOP_TRUNCATED_PAGE, prepend AOP_ to WRITEPAGE_ACTIVATE 2006-01-03 11:45:42 -08:00
rmap.c [PATCH] rmap: additional diagnostics in page_remove_rmap() 2006-01-08 20:12:44 -08:00
shmem.c [PATCH] NOMMU: Make SYSV IPC SHM use ramfs facilities on NOMMU 2006-01-06 08:33:32 -08:00
slab.c [PATCH] slob: introduce mm/util.c for shared functions 2006-01-08 20:13:41 -08:00
slob.c [PATCH] slob: introduce the SLOB allocator 2006-01-08 20:13:41 -08:00
sparse.c [PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros 2006-01-08 20:13:38 -08:00
swap.c [PATCH] consolidate lru_add_drain() and lru_drain_cache() 2006-01-06 08:33:28 -08:00
swap_state.c [PATCH] SwapMig: add_to_swap() avoid atomic allocations 2006-01-08 20:12:42 -08:00
swapfile.c [PATCH] mm: clean up local variables 2006-01-08 20:12:43 -08:00
thrash.c [PATCH] temporarily disable swap token on memory pressure 2005-11-28 14:42:25 -08:00
tiny-shmem.c [PATCH] NOMMU: Make SYSV IPC SHM use ramfs facilities on NOMMU 2006-01-06 08:33:32 -08:00
truncate.c [PATCH] drop-pagecache 2006-01-08 20:12:40 -08:00
util.c [PATCH] slob: introduce mm/util.c for shared functions 2006-01-08 20:13:41 -08:00
vmalloc.c [PATCH] kernel-doc: fix warnings in vmalloc.c 2005-11-07 07:53:56 -08:00
vmscan.c [PATCH] SwapMig: Switch error handling in migrate_pages to use -Exx 2006-01-08 20:12:42 -08:00