Subject: how to increase NKMEMPAGES_MAX to as large as possible?
To: None <tech-kern@NetBSD.org>
From: Ricardo Chen <chenpeng@semptian.com>
List: tech-kern
Date: 06/05/2006 21:00:45
Hello,
=20
I'm writing a program which needs a large numbers of kernel memory =
entries (about 500-600MB) allocated by kernel's MALLOC, currently my x86 =
machine has 1GB physical memory, I'm trying to increase NKMEMPAGES to =
"((768 * 1024 * 1024) >> PAGE_SHIFT)" but the tuned system goes panic =
soon after boot, then I decrease NKMEMPAGES to "((512* 1024 * 1024) >> =
PAGE_SHIFT)" and panic again, then only when I decrease the value to =
"((384 * 1024 * 1024) >> PAGE_SHIFT)" , the system works OK.=20
Could anybody help me to increase the parameter of NKMEMPAGES_MAX to as =
large as possible? What else do I need to do in order to use the =
remaining memory larger than 384MB?
I'm using NetBSD 3.0, by reading the code, I find the panic is caused by =
the failure of "KASSERT(vm_map_pmap(map) =3D=3D pmap_kernel()" in =
function uvm_km_suballoc(when the DIAGNOSTIC building option on); if =
without DIAGNOSTIC option, the UVMHIST_PRINT log before the panic looks =
like the following attachment:
000000.000000 uvm_map_init#0@0: called!
000000.000000 uvm_map_init#0@0: <starting uvm map system>
000000.000000 uvm_map_prepare#0@0: called!
000000.000000 uvm_map_prepare#0@0: (map=3D0xc0420d20, =
start=3D0xc0000000, size=3D13725696, flags=3D0x11727)
000000.000000 uvm_map_prepare#0@0: uobj/offset 0x0/-1
000000.000000 uvm_map_findspace#0@0: called!
000000.000000 uvm_map_findspace#0@0: (map=3D0xc0420d20, =
hint=3D0xc0000000, len=3D13725696, flags=3D0x11727)
000000.000000 uvm_map_lookup_entry#0@0: called!
000000.000000 uvm_map_lookup_entry#0@0: =
(map=3D0xc0420d20,addr=3D0xc0000000,ent=3D0xc04d7e68)
000000.000000 uvm_map_lookup_entry#0@0: <- failed!
000000.000000 uvm_map_findspace#0@0: <- got it! (result=3D0xc0000000)
000000.000000 uvm_map_enter#0@0: called!
000000.000000 uvm_map_enter#0@0: (map=3D0xc0420d20, start=3D0xc0000000, =
size=3D13725696, flags=3D0x11727)
000000.000000 uvm_map_enter#0@0: uobj/offset 0x0/0
000000.000000 uvm_map_enter#0@0: allocating new map entry
000000.000000 uvm_map_enter#0@0: <- done!
000000.000000 uvm_km_alloc1#0@0: called!
000000.000000 uvm_km_alloc1#0@0: (map=3D0xc0420d20, size=3D0x1000)
000000.000000 uvm_mapent_alloc#0@0: called!
000000.000000 uvm_map_prepare#1@0: called!
000000.000000 uvm_map_prepare#1@0: (map=3D0xc0420d20, start=3D0x0, =
size=3D4096, flags=3D0x41727)
000000.000000 uvm_map_prepare#1@0: uobj/offset 0x0/0
000000.000000 uvm_map_findspace#1@0: called!
000000.000000 uvm_map_findspace#1@0: (map=3D0xc0420d20, hint=3D0x0, =
len=3D4096, flags=3D0x41727)
000000.000000 uvm_map_findspace#1@0: <- got it! (result=3D0xc0d17000)
000000.000000 uvm_map_enter#1@0: called!
000000.000000 uvm_map_enter#1@0: (map=3D0xc0420d20, start=3D0xc0d17000, =
size=3D4096, flags=3D0x41727)
000000.000000 uvm_map_enter#1@0: uobj/offset 0x0/0
000000.000000 uvm_map_enter#1@0: allocating new map entry
000000.000000 uvm_map_enter#1@0: <- done!
000000.000000 uvm_mapent_alloc#0@0: <- new entry=3D0xc0d1706c =
[kentry=3D1]
000000.000000 uvm_map_prepare#2@0: called!
000000.000000 uvm_map_prepare#2@0: (map=3D0xc0420d20, =
start=3D0xc0000000, size=3D4096, flags=3D0x801727)
000000.000000 uvm_map_prepare#2@0: uobj/offset 0xc0420ca0/-1
000000.000000 uvm_map_findspace#2@0: called!
000000.000000 uvm_map_findspace#2@0: (map=3D0xc0420d20, =
hint=3D0xc0000000, len=3D4096, flags=3D0x801727)
000000.000000 uvm_map_findspace#2@0: <- got it! (result=3D0xc0d18000)
000000.000000 uvm_map_enter#2@0: called!
000000.000000 uvm_map_enter#2@0: (map=3D0xc0420d20, start=3D0xc0d18000, =
size=3D4096, flags=3D0x801727)
000000.000000 uvm_map_enter#2@0: uobj/offset 0xc0420ca0/13729792
000000.000000 uvm_map_enter#2@0: allocating new map entry
000000.000000 uvm_map_enter#2@0: <- done!
000000.000000 uvm_km_alloc1#0@0: kva=3D0xc0d18000, offset=3D0xd18000
000000.000000 uvm_km_alloc1#0@0: <- done (kva=3D0xc0d18000)
000000.000000 uvm_km_alloc1#1@0: called!
000000.000000 uvm_km_alloc1#1@0: (map=3D0xc0420d20, size=3D0x1000)
000000.000000 uvm_mapent_alloc#1@0: called!
000000.000000 uvm_mapent_alloc#1@0: <- new entry=3D0xc0d170c4 =
[kentry=3D1]
000000.000000 uvm_map_prepare#3@0: called!
000000.000000 uvm_map_prepare#3@0: (map=3D0xc0420d20, =
start=3D0xc0000000, size=3D4096, flags=3D0x801727)
000000.000000 uvm_map_prepare#3@0: uobj/offset 0xc0420ca0/-1
000000.000000 uvm_map_findspace#3@0: called!
000000.000000 uvm_map_findspace#3@0: (map=3D0xc0420d20, =
hint=3D0xc0000000, len=3D4096, flags=3D0x801727)
000000.000000 uvm_map_findspace#3@0: <- got it! (result=3D0xc0d19000)
000000.000000 uvm_map_enter#3@0: called!
000000.000000 uvm_map_enter#3@0: (map=3D0xc0420d20, start=3D0xc0d19000, =
size=3D4096, flags=3D0x801727)
000000.000000 uvm_map_enter#3@0: uobj/offset 0xc0420ca0/13733888
000000.000000 uvm_map_enter#3@0: starting back merge
000000.000000 uao_detach#0@0: called!
000000.000000 uvm_map_enter#3@0: <- done (via backmerge)!
000000.000000 uvm_map_enter#3@0: <- done!
000000.000000 uvm_km_alloc1#1@0: kva=3D0xc0d19000, offset=3D0xd19000
000000.000000 uvm_km_alloc1#1@0: <- done (kva=3D0xc0d19000)
000000.000000 uvm_km_alloc1#2@0: called!
000000.000000 uvm_km_alloc1#2@0: (map=3D0xc0420d20, size=3D0x7fe80)
000000.000000 uvm_mapent_alloc#2@0: called!
000000.000000 uvm_mapent_alloc#2@0: <- new entry=3D0xc0d1711c =
[kentry=3D1]
000000.000000 uvm_map_prepare#4@0: called!
000000.000000 uvm_map_prepare#4@0: (map=3D0xc0420d20, =
start=3D0xc0000000, size=3D524288, flags=3D0x801727)
000000.000000 uvm_map_prepare#4@0: uobj/offset 0xc0420ca0/-1
000000.000000 uvm_map_findspace#4@0: called!
000000.000000 uvm_map_findspace#4@0: (map=3D0xc0420d20, =
hint=3D0xc0000000, len=3D524288, flags=3D0x801727)
000000.000000 uvm_map_findspace#4@0: <- got it! (result=3D0xc0d1a000)
000000.000000 uvm_map_enter#4@0: called!
000000.000000 uvm_map_enter#4@0: (map=3D0xc0420d20, start=3D0xc0d1a000, =
size=3D524288, flags=3D0x801727)
000000.000000 uvm_map_enter#4@0: uobj/offset 0xc0420ca0/13737984
000000.000000 uvm_map_enter#4@0: starting back merge
000000.000000 uao_detach#1@0: called!
000000.000000 uvm_map_enter#4@0: <- done (via backmerge)!
000000.000000 uvm_map_enter#4@0: <- done!
000000.000000 uvm_km_alloc1#2@0: kva=3D0xc0d1a000, offset=3D0xd1a000
000000.000000 uvm_km_kmemalloc#0@0: called!
000000.000000 uvm_km_kmemalloc#0@0: (map=3D0x0, obj=3D0x0, =
size=3D0x1000, flags=3D2097153)
Thanks,
Ricardo=20