Subject: Re: Still unable to compile a working kernel on NoName.
To: Michael Graff <explorer@flame.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-alpha
Date: 07/31/1997 01:49:59
On 31 Jul 1997 04:28:27 -0400 
 Michael Graff <explorer@flame.org> wrote:

 > > call anywhere near line 740 of machdep.c.  That line is in identifycpu().
 > 
 > This is what I have at line 740:

For me:

/* $NetBSD: machdep.c,v 1.80 1997/06/12 15:46:19 mrg Exp $ */

 .
 .
 .
            ctob(totalphysmem), ctob(resvmem), ctob(physmem)); <-- line 640
 .
 .
 .
        printf("serial number 0x%lx 0x%lx\n",		<-- line 740

...but whatever :-)

(I.e. please include the file revision :-)

 > 	/*
 > 	 * Allocate virtual address space for file I/O buffers.
 > 	 * Note they are different than the array of headers, 'buf',
 > 	 * and usually occupy more virtual memory than physical.
 > 	 */
 > 	size = MAXBSIZE * nbuf;
 > -->	buffer_map = kmem_suballoc(kernel_map, (vm_offset_t *)&buffers,
 > 	    &maxaddr, size, TRUE);
 > 	minaddr = (vm_offset_t)buffers;
 > 	if (vm_map_find(buffer_map, vm_object_allocate(size), (vm_offset_t)0,
 > 			&minaddr, size, FALSE) != KERN_SUCCESS)
 > 		panic("startup: cannot allocate buffers");
 > 
 > That looks like a call to kmem_suballoc() to me!  :)  Also, I placed a
 > printf directly below the call to kmem_suballoc and one above it.  The
 > one above it did print, the one below did not.
 > 
 > > How far into kmem_suballoc() does it get?
 > > 
 > > printf() is your friend :-)
 > 
 > That's how I found the bug in the first place :)
 > 
 > BTW, I have not increased NBUF intentionally:
 > 
 > explorer@kechara:/sys/arch/alpha/conf> grep NBUF GESTEN
 > explorer@kechara:/sys/arch/alpha/conf> 
 > 
 > I have traced the lockup to vm_map_create() currently.  My _guess_ is
 > that it is locking on the MALLOC call in there...  I'm adding printfs
 > now and will followup once it compiles and I try it.

I would say that the M_WAITOK is _wrong_.  But, that is supposed to be
handled properly while "cold == 1".  Hmm...

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-6                                       Work: +1 415 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939