linux/arch/x86/mm
Jeremy Fitzhardinge 93dbda7cbc x86: add brk allocation for very, very early allocations
Impact: new interface

Add a brk()-like allocator which effectively extends the bss in order
to allow very early code to do dynamic allocations.  This is better than
using statically allocated arrays for data in subsystems which may never
get used.

The space for brk allocations is in the bss ELF segment, so that the
space is mapped properly by the code which maps the kernel, and so
that bootloaders keep the space free rather than putting a ramdisk or
something into it.

The bss itself, delimited by __bss_stop, ends before the brk area
(__brk_base to __brk_limit).  The kernel text, data and bss is reserved
up to __bss_stop.

Any brk-allocated data is reserved separately just before the kernel
pagetable is built, as that code allocates from unreserved spaces
in the e820 map, potentially allocating from any unused brk memory.
Ultimately any unused memory in the brk area is used in the general
kernel memory pool.

Initially the brk space is set to 1MB, which is probably much larger
than any user needs (the largest current user is i386 head_32.S's code
to build the pagetables to map the kernel, which can get fairly large
with a big kernel image and no PSE support).  So long as the system
has sufficient memory for the bootloader to reserve the kernel+1MB brk,
there are no bad effects resulting from an over-large brk.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-03-14 15:37:14 -07:00
..
dump_pagetables.c
extable.c
fault.c
gup.c
highmem_32.c x86: debug check for kmap_atomic_pfn and iomap_atomic_prot_pfn() 2009-03-11 15:47:46 +01:00
hugetlbpage.c
init.c x86: fix uninitialized variable in init_memory_mapping() 2009-03-06 15:25:52 +01:00
init_32.c x86: fix warning about nodeid 2009-03-08 19:34:17 +01:00
init_64.c x86: rename do_not_nx to disable_nx in mm/init_64.c 2009-03-06 15:25:52 +01:00
iomap_32.c x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn() 2009-03-11 15:47:46 +01:00
ioremap.c Merge branches 'x86/apic', 'x86/asm', 'x86/fixmap', 'x86/memtest', 'x86/mm', 'x86/urgent', 'linus' and 'core/percpu' into x86/core 2009-03-10 09:26:38 +01:00
k8topology_64.c
kmmio.c x86: mmiotrace: quieten spurious warning message 2009-03-11 21:41:58 +01:00
Makefile x86: unify free_init_pages() and free_initmem() 2009-03-03 12:21:18 +01:00
memtest.c x86: make "memtest" like "memtest=17" 2009-03-06 12:16:43 +01:00
mmap.c
mmio-mod.c
numa_32.c x86: fix bootmem cross node for 32bit numa 2009-03-04 20:55:03 +01:00
numa_64.c
pageattr-test.c
pageattr.c x86: add brk allocation for very, very early allocations 2009-03-14 15:37:14 -07:00
pat.c Merge branch 'x86/urgent' into x86/pat 2009-03-01 12:47:58 +01:00
pf_in.c
pf_in.h
pgtable.c x86, fixmap: define reserve_top_address for x86_64 2009-02-27 20:57:47 -08:00
pgtable_32.c Merge branches 'x86/apic', 'x86/cpu', 'x86/fixmap', 'x86/mm', 'x86/sched', 'x86/setup-lzma', 'x86/signal' and 'x86/urgent' into x86/core 2009-03-04 02:22:31 +01:00
srat_32.c
srat_64.c
testmmiotrace.c x86: add far read test to testmmiotrace 2009-03-02 10:20:35 +01:00
tlb.c