This commit is contained in:
mrg 1998-02-07 12:45:53 +00:00
parent 5e55ce6648
commit 4ef57d4d22
1 changed files with 139 additions and 141 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_meter.c,v 1.3 1998/02/07 11:09:08 mrg Exp $ */
/* $NetBSD: uvm_meter.c,v 1.4 1998/02/07 12:45:53 mrg Exp $ */
/*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -79,9 +79,8 @@ static void uvm_total __P((struct vmtotal *));
/*
* uvm_meter: calculate load average and wake up the swapper (if needed)
*/
void uvm_meter()
void
uvm_meter()
{
if ((time.tv_sec % 5) == 0)
uvm_loadav(&averunnable);
@ -93,10 +92,9 @@ void uvm_meter()
* uvm_loadav: compute a tenex style load average of a quantity on
* 1, 5, and 15 minute internvals.
*/
static void uvm_loadav(avg)
struct loadavg *avg;
static void
uvm_loadav(avg)
struct loadavg *avg;
{
int i, nrun;
struct proc *p;
@ -120,16 +118,15 @@ struct loadavg *avg;
/*
* uvm_sysctl: sysctl hook into UVM system.
*/
int uvm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int *name;
u_int namelen;
void *oldp;
size_t *oldlenp;
void *newp;
size_t newlen;
struct proc *p;
int
uvm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int *name;
u_int namelen;
void *oldp;
size_t *oldlenp;
void *newp;
size_t newlen;
struct proc *p;
{
struct vmtotal vmtotals;
@ -141,12 +138,15 @@ struct proc *p;
case VM_LOADAVG:
return (sysctl_rdstruct(oldp, oldlenp, newp, &averunnable,
sizeof(averunnable)));
case VM_METER:
uvm_total(&vmtotals);
return (sysctl_rdstruct(oldp, oldlenp, newp, &vmtotals,
sizeof(vmtotals)));
case VM_UVMEXP:
return (sysctl_rdstruct(oldp, oldlenp, newp, &uvmexp, sizeof(uvmexp)));
return (sysctl_rdstruct(oldp, oldlenp, newp, &uvmexp,
sizeof(uvmexp)));
default:
return (EOPNOTSUPP);
@ -157,11 +157,9 @@ struct proc *p;
/*
* uvm_total: calculate the current state of the system.
*/
static void uvm_total(totalp)
struct vmtotal *totalp;
static void
uvm_total(totalp)
struct vmtotal *totalp;
{
struct proc *p;
#if 0