kernel_optimize_test/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 x86: uaccess: introduce try and catch framework 2009-01-23 17:17:36 -08:00
fault.c x86, mm: fault.c, simplify kmmio_fault(), cleanup 2009-02-22 10:24:18 +01:00
gup.c x86: two trivial sparse annotations 2008-10-29 08:02:28 +01:00
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_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
init.c x86: fix uninitialized variable in init_memory_mapping() 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 x86: k8 numa register active regions later 2009-01-06 13:21:21 +01:00
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 x86: update copyrights 2009-01-31 04:21:18 +01:00
mmio-mod.c mmiotrace: remove left-over marker cruft 2008-10-14 10:37:17 +02:00
numa_32.c x86: fix bootmem cross node for 32bit numa 2009-03-04 20:55:03 +01:00
numa_64.c Merge branch 'linus' into x86/apic 2009-02-22 20:05:19 +01:00
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 x86: fix mmiotrace 8-bit register decoding 2008-10-14 10:33:50 +02:00
pf_in.h
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
pgtable.c x86, fixmap: define reserve_top_address for x86_64 2009-02-27 20:57:47 -08:00
srat_32.c
srat_64.c x86, apic: remove genapic.h 2009-02-17 17:52:44 +01:00
testmmiotrace.c x86: add far read test to testmmiotrace 2009-03-02 10:20:35 +01:00
tlb.c x86, apic: remove duplicate asm/apic.h inclusions 2009-02-17 17:52:44 +01:00