Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Sep 2002 22:52:38 -0300 (ADT)
From:      "Marc G. Fournier" <scrappy@hub.org>
To:        Gregory Bond <gnb@itga.com.au>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, <freebsd-stable@FreeBSD.ORG>
Subject:   Re: Problems with FreeBSD - causing zalloc to return 0 ?! 
Message-ID:  <20020901225155.E14529-100000@hub.org>
In-Reply-To: <200209020145.LAA18441@lightning.itga.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020901225155.E14529-100000>