From owner-freebsd-stable Sun Sep 1 18:45:17 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 5666737B400 for ; Sun, 1 Sep 2002 18:45:13 -0700 (PDT) Received: from ns.itga.com.au (ns.itga.com.au [202.53.40.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BEEC43E6E for ; Sun, 1 Sep 2002 18:45:12 -0700 (PDT) (envelope-from gnb@itga.com.au) Received: from lightning.itga.com.au (lightning.itga.com.au [192.168.71.20]) by ns.itga.com.au (8.9.3/8.9.3) with ESMTP id LAA73190; Mon, 2 Sep 2002 11:45:10 +1000 (EST) (envelope-from gnb@itga.com.au) Received: from lightning.itga.com.au (localhost [127.0.0.1]) by lightning.itga.com.au (8.9.3/8.9.3) with ESMTP id LAA18441; Mon, 2 Sep 2002 11:45:10 +1000 (EST) Message-Id: <200209020145.LAA18441@lightning.itga.com.au> X-Mailer: exmh version 2.4 05/15/2001 with nmh-1.0.4 From: Gregory Bond To: Matthew Dillon Cc: freebsd-stable@FreeBSD.ORG Subject: Re: Problems with FreeBSD - causing zalloc to return 0 ?! In-reply-to: Your message of Sat, 31 Aug 2002 19:26:51 -0700. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 02 Sep 2002 11:45:10 +1000 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 > 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