Subject: Re: System crash with too much memory
To: Christos Zoulas <christos@zoulas.com>
From: D'Arcy J.M. Cain <darcy@NetBSD.org>
List: tech-kern
Date: 04/22/2003 17:58:05
On Tuesday 22 April 2003 10:18, Christos Zoulas wrote:
> In article <200304221008.31432.darcy@NetBSD.org>,
> >panic: cpu_startup: cannot allocate VM for buffers
> >Stopped in pid 0 ( ) at cpu_debugger +0x4: leave
>
> maybe we need to clamp nbuf to let's say 8000?
> try doing so in machdep.c...

Well, I get a different error.  :-)

panic: startup: table size inconsistiency

A print statement shows that when 4GB is installed the number is 50810 nbufs 
while with 2GB it is 6144.  Here is where I tried to change it:

    /*
     * Find out how much space we need, allocate it,
     * and then give everything true virtual addresses.
     */
    sz = (int)allocsys(NULL, NULL);
    if (nbuf > 8000) nbuf = 8000;            /* XXX Added */
    if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0)
        panic("startup: no room for tables");
    if (allocsys(v, NULL) - v != sz)
        panic("startup: table size inconsistency");

I guess I have to track down allocsys and fix it there.

-- 
D'Arcy J.M. Cain <darcy@netbsd.org>
http://www.NetBSD.org/