From owner-freebsd-stable Sun Sep 1 18:52:52 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0EDC37B405 for ; Sun, 1 Sep 2002 18:52:44 -0700 (PDT) Received: from earth.hub.org (earth.hub.org [64.49.215.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7613E43E3B for ; Sun, 1 Sep 2002 18:52:44 -0700 (PDT) (envelope-from scrappy@hub.org) Received: from earth.hub.org (earth.hub.org [64.49.215.11]) by earth.hub.org (Postfix) with ESMTP id 622BF2CC7F0; Sun, 1 Sep 2002 22:52:38 -0300 (ADT) Date: Sun, 1 Sep 2002 22:52:38 -0300 (ADT) From: "Marc G. Fournier" To: Gregory Bond Cc: Matthew Dillon , Subject: Re: Problems with FreeBSD - causing zalloc to return 0 ?! In-Reply-To: <200209020145.LAA18441@lightning.itga.com.au> Message-ID: <20020901225155.E14529-100000@hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Okay, just to confirm, but kernel_vm_end gives me: kernel_vm_end: 0xf1400000 and vm.kvm_free: vm.kvm_free: 239075328 so I have 239Meg free? *raised eyebrow* On Mon, 2 Sep 2002, Gregory Bond wrote: > > If kernel_vm_end reaches 0xFFC00000 (or somewhere very close to > > that), then you have run out of KVM. > > So how about a warning message when pmap_growkernel() sets it to something near > this? > > [I'm no kernel hacker, but afaict printf() is legal at splhigh(). And I don't > really know the sort of quantum that is passed to pmap_growkernel() so I'm not > sure if 16Mb is too big or too small...] > > BTW: "sysctl vm.kvm_free" will show the number of bytes of free KVM so might > be a better trick than gdb in the monitoring script. > > --- sys/i386/i386/pmap.c Fri Mar 15 13:52:54 2002 > +++ sys/i386/i386/pmap.c.warn Mon Sep 2 11:34:45 2002 > @@ -1468,6 +1468,15 @@ > } > *pmap_pde(kernel_pmap, kernel_vm_end) = newpdir; > kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1); > + > + /* > + * Running kernel_vm_end to VM_MAX_KERNEL_ADDRESS is known to > + * be fatal in confusing ways, so give a bit of a hint when > + * we get near it so the crashes are less mysterious! > + */ > +#define VM_KERN_WARNLEVEL 0x1000000 > + if (VM_MAX_KERNEL_ADDRESS - kernel_vm_end < VM_KERN_WARNLEVEL) > + printf("warning: kernel VM space (0x%x) almost exhausted!", kernel_vm_end); > } > splx(s); > } > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message