diff options
author | peter <peter@FreeBSD.org> | 2001-08-22 00:50:46 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-08-22 00:50:46 +0000 |
commit | b6d83b57c8b4c0005bbfe32530e296298e941273 (patch) | |
tree | 4e4d92b87bd67d43cdb0f039cc3945d89e2f020e /sys/i386 | |
parent | 92a5a6fdf05c5817bd49654e431cee30ca57d6a8 (diff) | |
download | FreeBSD-src-b6d83b57c8b4c0005bbfe32530e296298e941273.zip FreeBSD-src-b6d83b57c8b4c0005bbfe32530e296298e941273.tar.gz |
Introduce two new sysctl's.. vm.kvm_size and vm.kvm_free. These are
purely informational and can give some advance indications of tuning
problems. These are i386 only for now as it seems that the i386 is
the only one suffering kvm pressure.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index f2d447f..7a32c98b 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -83,6 +83,7 @@ #include <sys/sx.h> #include <sys/user.h> #include <sys/vmmeter.h> +#include <sys/sysctl.h> #include <vm/vm.h> #include <vm/vm_param.h> @@ -1366,6 +1367,26 @@ retry: if (ptdpg && !pmap_release_free_page(pmap, ptdpg)) goto retry; } + +static int +kvm_size(SYSCTL_HANDLER_ARGS) +{ + unsigned long ksize = VM_MAX_KERNEL_ADDRESS - KERNBASE; + + return sysctl_handle_long(oidp, &ksize, 0, req); +} +SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, + 0, 0, kvm_size, "IU", "Size of KVM"); + +static int +kvm_free(SYSCTL_HANDLER_ARGS) +{ + unsigned long kfree = VM_MAX_KERNEL_ADDRESS - kernel_vm_end; + + return sysctl_handle_long(oidp, &kfree, 0, req); +} +SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, + 0, 0, kvm_free, "IU", "Amount of KVM free"); /* * grow the number of kernel page table entries, if needed |