From: Ingo Molnar on

i've done some testing of the bits Peter has merged into x86/bootmem in -tip,
and it crashes during early bootup with:

[ 0.000000] #8 [0000012000 - 000001a000] BOOTMAP ==> [0000012000 - 000001a000]
[ 0.000000] bootmem alloc of 4194304 bytes failed!
[ 0.000000] Kernel panic - not syncing: Out of memory
[ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.33-rc7-tip-00770-g525df42-dirty #16566
[ 0.000000] Call Trace:
[ 0.000000] [<ffffffff8167410b>] panic+0x75/0x146
[ 0.000000] [<ffffffff832b0a04>] ___alloc_bootmem_node+0x0/0x60
[ 0.000000] [<ffffffff832b0c27>] __alloc_bootmem+0xb/0xd
[ 0.000000] [<ffffffff832b2d7b>] sparse_init+0x34/0x2d9
[ 0.000000] [<ffffffff832b0dc9>] ? reserve_bootmem+0x20/0x22
[ 0.000000] [<ffffffff832aac44>] paging_init+0x43/0x52
[ 0.000000] [<ffffffff8329fb2e>] setup_arch+0x583/0x615
[ 0.000000] [<ffffffff8105e794>] ? clockevents_register_notifier+0x3e/0x4a
[ 0.000000] [<ffffffff8329db07>] start_kernel+0xf3/0x349
[ 0.000000] [<ffffffff8329d276>] x86_64_start_reservations+0x7d/0x81
[ 0.000000] [<ffffffff8329d3c6>] x86_64_start_kernel+0x14c/0x15b
[ 0.000000] Rebooting in 1 seconds..Press any key to enter the menu

full bootlog below, config attached.

Thanks,

Ingo

[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.33-rc7-tip-00770-g525df42-dirty (mingo(a)sirius) (gcc version 4.4.1 20091008 (Red Hat 4.4.1-20) (GCC) ) #16566 SMP Thu Feb 11 18:35:25 CET 2010
[ 0.000000] Command line: root=/dev/sda6 earlyprintk=ttyS0,115200 console=ttyS0,115200 debug initcall_debug sysrq_always_enabled ignore_loglevel selinux=0 nmi_watchdog=0 panic=1 3
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
[ 0.000000] BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
[ 0.000000] BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
[ 0.000000] BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
[ 0.000000] BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
[ 0.000000] BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
[ 0.000000] BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
[ 0.000000] bootconsole [earlyser0] enabled
[ 0.000000] debug: ignoring loglevel setting.
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] e820 update range: 0000000000000000 - 0000000000001000 (usable) ==> (reserved)
[ 0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
[ 0.000000] last_pfn = 0x3fff0 max_arch_pfn = 0x400000000
[ 0.000000] MTRR default type: uncachable
[ 0.000000] MTRR fixed ranges enabled:
[ 0.000000] 00000-9FFFF write-back
[ 0.000000] A0000-BFFFF uncachable
[ 0.000000] C0000-C7FFF write-protect
[ 0.000000] C8000-FFFFF uncachable
[ 0.000000] MTRR variable ranges enabled:
[ 0.000000] 0 base 0000000000 mask FFC0000000 write-back
[ 0.000000] 1 disabled
[ 0.000000] 2 disabled
[ 0.000000] 3 disabled
[ 0.000000] 4 disabled
[ 0.000000] 5 disabled
[ 0.000000] 6 disabled
[ 0.000000] 7 disabled
[ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[ 0.000000] e820 update range: 0000000000001000 - 0000000000010000 (usable) ==> (reserved)
[ 0.000000] Scanning 1 areas for low memory corruption
[ 0.000000] modified physical RAM map:
[ 0.000000] modified: 0000000000000000 - 0000000000010000 (reserved)
[ 0.000000] modified: 0000000000010000 - 000000000009f800 (usable)
[ 0.000000] modified: 000000000009f800 - 00000000000a0000 (reserved)
[ 0.000000] modified: 00000000000f0000 - 0000000000100000 (reserved)
[ 0.000000] modified: 0000000000100000 - 000000003fff0000 (usable)
[ 0.000000] modified: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
[ 0.000000] modified: 000000003fff3000 - 0000000040000000 (ACPI data)
[ 0.000000] modified: 00000000e0000000 - 00000000f0000000 (reserved)
[ 0.000000] modified: 00000000fec00000 - 0000000100000000 (reserved)
[ 0.000000] initial memory mapped : 0 - 20000000
[ 0.000000] found SMP MP-table at [ffff8800000f5680] f5680
[ 0.000000] init_memory_mapping: 0000000000000000-000000003fff0000
[ 0.000000] 0000000000 - 003fff0000 page 4k
[ 0.000000] kernel direct mapping tables up to 3fff0000 @ 100000-302000
[ 0.000000] (9/32 early reservations) ==> bootmem [0000000000 - 003fff0000]
[ 0.000000] #0 [0001000000 - 000816f1f0] TEXT DATA BSS ==> [0001000000 - 000816f1f0]
[ 0.000000] #1 [00000f5690 - 0000100000] BIOS reserved ==> [00000f5690 - 0000100000]
[ 0.000000] #2 [00000f5680 - 00000f5690] MP-table mpf ==> [00000f5680 - 00000f5690]
[ 0.000000] #3 [000009f800 - 00000f1400] BIOS reserved ==> [000009f800 - 00000f1400]
[ 0.000000] #4 [00000f152c - 00000f5680] BIOS reserved ==> [00000f152c - 00000f5680]
[ 0.000000] #5 [00000f1400 - 00000f152c] MP-table mpc ==> [00000f1400 - 00000f152c]
[ 0.000000] #6 [0000010000 - 0000012000] TRAMPOLINE ==> [0000010000 - 0000012000]
[ 0.000000] #7 [0000100000 - 0000300000] PGTABLE ==> [0000100000 - 0000300000]
[ 0.000000] #8 [0000012000 - 000001a000] BOOTMAP ==> [0000012000 - 000001a000]
[ 0.000000] bootmem alloc of 4194304 bytes failed!
[ 0.000000] Kernel panic - not syncing: Out of memory
[ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.33-rc7-tip-00770-g525df42-dirty #16566
[ 0.000000] Call Trace:
[ 0.000000] [<ffffffff8167410b>] panic+0x75/0x146
[ 0.000000] [<ffffffff832b0a04>] ___alloc_bootmem_node+0x0/0x60
[ 0.000000] [<ffffffff832b0c27>] __alloc_bootmem+0xb/0xd
[ 0.000000] [<ffffffff832b2d7b>] sparse_init+0x34/0x2d9
[ 0.000000] [<ffffffff832b0dc9>] ? reserve_bootmem+0x20/0x22
[ 0.000000] [<ffffffff832aac44>] paging_init+0x43/0x52
[ 0.000000] [<ffffffff8329fb2e>] setup_arch+0x583/0x615
[ 0.000000] [<ffffffff8105e794>] ? clockevents_register_notifier+0x3e/0x4a
[ 0.000000] [<ffffffff8329db07>] start_kernel+0xf3/0x349
[ 0.000000] [<ffffffff8329d276>] x86_64_start_reservations+0x7d/0x81
[ 0.000000] [<ffffffff8329d3c6>] x86_64_start_kernel+0x14c/0x15b
[ 0.000000] Rebooting in 1 seconds..Press any key to enter the menu

From: Yinghai Lu on
On 02/11/2010 08:14 AM, Ingo Molnar wrote:
>
> i've done some testing of the bits Peter has merged into x86/bootmem in -tip,
> and it crashes during early bootup with:
>
> [ 0.000000] #8 [0000012000 - 000001a000] BOOTMAP ==> [0000012000 - 000001a000]
> [ 0.000000] bootmem alloc of 4194304 bytes failed!
> [ 0.000000] Kernel panic - not syncing: Out of memory
> [ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.33-rc7-tip-00770-g525df42-dirty #16566
> [ 0.000000] Call Trace:
> [ 0.000000] [<ffffffff8167410b>] panic+0x75/0x146
> [ 0.000000] [<ffffffff832b0a04>] ___alloc_bootmem_node+0x0/0x60
> [ 0.000000] [<ffffffff832b0c27>] __alloc_bootmem+0xb/0xd
> [ 0.000000] [<ffffffff832b2d7b>] sparse_init+0x34/0x2d9
> [ 0.000000] [<ffffffff832b0dc9>] ? reserve_bootmem+0x20/0x22
> [ 0.000000] [<ffffffff832aac44>] paging_init+0x43/0x52
> [ 0.000000] [<ffffffff8329fb2e>] setup_arch+0x583/0x615
> [ 0.000000] [<ffffffff8105e794>] ? clockevents_register_notifier+0x3e/0x4a
> [ 0.000000] [<ffffffff8329db07>] start_kernel+0xf3/0x349
> [ 0.000000] [<ffffffff8329d276>] x86_64_start_reservations+0x7d/0x81
> [ 0.000000] [<ffffffff8329d3c6>] x86_64_start_kernel+0x14c/0x15b
> [ 0.000000] Rebooting in 1 seconds..Press any key to enter the menu

sorry, i deleted one line by mistake...

please check

Subject: [PATCH] x86: fix bootmem with non numa after early_res change

Ingo found early_res replacing bootmem code broke original bootmem code for non numa
it crashes during early bootup with:

[ 0.000000] #8 [0000012000 - 000001a000] BOOTMAP ==> [0000012000 - 000001a000]
[ 0.000000] bootmem alloc of 4194304 bytes failed!
[ 0.000000] Kernel panic - not syncing: Out of memory
[ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.33-rc7-tip-00770-g525df42-dirty #16566
[ 0.000000] Call Trace:
[ 0.000000] [<ffffffff8167410b>] panic+0x75/0x146
[ 0.000000] [<ffffffff832b0a04>] ___alloc_bootmem_node+0x0/0x60
[ 0.000000] [<ffffffff832b0c27>] __alloc_bootmem+0xb/0xd
[ 0.000000] [<ffffffff832b2d7b>] sparse_init+0x34/0x2d9
[ 0.000000] [<ffffffff832b0dc9>] ? reserve_bootmem+0x20/0x22
[ 0.000000] [<ffffffff832aac44>] paging_init+0x43/0x52
[ 0.000000] [<ffffffff8329fb2e>] setup_arch+0x583/0x615
[ 0.000000] [<ffffffff8105e794>] ? clockevents_register_notifier+0x3e/0x4a
[ 0.000000] [<ffffffff8329db07>] start_kernel+0xf3/0x349
[ 0.000000] [<ffffffff8329d276>] x86_64_start_reservations+0x7d/0x81
[ 0.000000] [<ffffffff8329d3c6>] x86_64_start_kernel+0x14c/0x15b
[ 0.000000] Rebooting in 1 seconds..Press any key to enter the menu

it turns out that one line should not be deleted...

need to be folded into

| commit 29a79bb1f526e506b97c7e2e794be16f8af16a01
| x86: Make 64 bit use early_res instead of bootmem before slab

Signed-off-by: Yinghai Lu <yinghai(a)kernel.org>

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 7ff9cee..276c4ea 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -584,6 +584,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
/* don't touch min_low_pfn */
bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap >> PAGE_SHIFT,
0, end_pfn);
+ e820_register_active_regions(0, start_pfn, end_pfn);
free_bootmem_with_active_regions(0, end_pfn);
#else
e820_register_active_regions(0, start_pfn, end_pfn);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Benjamin Herrenschmidt on
On Wed, 2010-02-10 at 01:20 -0800, Yinghai Lu wrote:
>
> The reserve_early() method is list/range based and can handle vast
> amounts of not very fragmented memory - perfect for basically all the
> real bootmem purposes (which is to bootstrap the buddy).
>
> reserve_early() allocated memory could be freed into the buddy later
> on
> as well. The main reason why bootmem is 'destroyed' during
> free-to-buddy
> is because it has excessive internal bitmaps we want to free. With a
> list/range based reserve_early() mechanism there's no such problem -
> they can linger indefinitely and there's near zero allocation
> management
> overhead. "

Various archs use lib/lmb.c for representing physical memory and
doing early allocations. Might be something to extend ?

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Yinghai Lu on
On 02/14/2010 06:27 PM, Benjamin Herrenschmidt wrote:
> On Wed, 2010-02-10 at 01:20 -0800, Yinghai Lu wrote:
>>
>> The reserve_early() method is list/range based and can handle vast
>> amounts of not very fragmented memory - perfect for basically all the
>> real bootmem purposes (which is to bootstrap the buddy).
>>
>> reserve_early() allocated memory could be freed into the buddy later
>> on
>> as well. The main reason why bootmem is 'destroyed' during
>> free-to-buddy
>> is because it has excessive internal bitmaps we want to free. With a
>> list/range based reserve_early() mechanism there's no such problem -
>> they can linger indefinitely and there's near zero allocation
>> management
>> overhead. "
>
> Various archs use lib/lmb.c for representing physical memory and
> doing early allocations. Might be something to extend ?

yes, could merge them later.

lmb: include memory range array, and reserved range array, and will be used till bootmem_init

early_res: is only reserved range array..., and need to be use with e820 map...
and now early_res is used to replace bootmem...

will check to make e820 to be fw_memmap and move it /kernel/fw_memmap.c

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/