schedclk() -> schedclock(), for consistency with hardclock(), statclock(), ...
update comments for recent scheduler mods
This commit is contained in:
parent
91d6272def
commit
e47e3c9f45
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: interrupt.c,v 1.37 1999/02/24 23:35:25 thorpej Exp $ */
|
||||
/* $NetBSD: interrupt.c,v 1.38 1999/02/28 18:14:57 ross Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.37 1999/02/24 23:35:25 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.38 1999/02/28 18:14:57 ross Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -130,7 +130,7 @@ interrupt(a0, a1, a2, framep)
|
|||
if((++schedclk2 & 0x3f) == 0
|
||||
&& (p = curproc) != NULL
|
||||
&& schedhz)
|
||||
schedclk(p);
|
||||
schedclock(p);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_clock.c,v 1.46 1999/02/23 17:41:48 mycroft Exp $ */
|
||||
/* $NetBSD: kern_clock.c,v 1.47 1999/02/28 18:14:57 ross Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1991, 1993
|
||||
|
@ -919,7 +919,7 @@ statclock(frame)
|
|||
register struct gmonparam *g;
|
||||
register int i;
|
||||
#endif
|
||||
static int schedclk2;
|
||||
static int schedclk;
|
||||
register struct proc *p;
|
||||
|
||||
if (CLKF_USERMODE(frame)) {
|
||||
|
@ -981,12 +981,12 @@ statclock(frame)
|
|||
if (p != NULL) {
|
||||
++p->p_cpticks;
|
||||
/*
|
||||
* If no schedclk is provided, call it here at ~~12-25 Hz,
|
||||
* If no schedclock is provided, call it here at ~~12-25 Hz,
|
||||
* ~~16 Hz is best
|
||||
*/
|
||||
if(schedhz == 0)
|
||||
if ((++schedclk2 & 3) == 0)
|
||||
schedclk(p);
|
||||
if ((++schedclk & 3) == 0)
|
||||
schedclock(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_synch.c,v 1.55 1999/02/23 02:56:03 ross Exp $ */
|
||||
/* $NetBSD: kern_synch.c,v 1.56 1999/02/28 18:14:57 ross Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1990, 1991, 1993
|
||||
|
@ -723,21 +723,22 @@ resetpriority(p)
|
|||
}
|
||||
|
||||
/*
|
||||
* We adjust the priority of the current process. The priority of
|
||||
* a process gets worse as it accumulates CPU time. The cpu usage
|
||||
* estimator (p_estcpu) is increased here. The formula for computing
|
||||
* priorities (in kern_synch.c) will compute a different value each
|
||||
* time p_estcpu increases by 4. The cpu usage estimator ramps up
|
||||
* quite quickly when the process is running (linearly), and decays
|
||||
* away exponentially, at a rate which is proportionally slower when
|
||||
* the system is busy. The basic principal is that the system will
|
||||
* 90% forget that the process used a lot of CPU time in 5 * loadav
|
||||
* seconds. This causes the system to favor processes which haven't
|
||||
* run much recently, and to round-robin among other processes.
|
||||
* We adjust the priority of the current process. The priority of a process
|
||||
* gets worse as it accumulates CPU time. The cpu usage estimator (p_estcpu)
|
||||
* is increased here. The formula for computing priorities (in kern_synch.c)
|
||||
* will compute a different value each time p_estcpu increases. This can
|
||||
* cause a switch, but unless the priority crosses a PPQ boundary the actual
|
||||
* queue will not change. The cpu usage estimator ramps up quite quickly
|
||||
* when the process is running (linearly), and decays away exponentially, at
|
||||
* a rate which is proportionally slower when the system is busy. The basic
|
||||
* principal is that the system will 90% forget that the process used a lot
|
||||
* of CPU time in 5 * loadav seconds. This causes the system to favor
|
||||
* processes which haven't run much recently, and to round-robin among other
|
||||
* processes.
|
||||
*/
|
||||
|
||||
void
|
||||
schedclk(p)
|
||||
schedclock(p)
|
||||
struct proc *p;
|
||||
{
|
||||
p->p_estcpu = ESTCPULIM(p->p_estcpu + 1);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sched.h,v 1.1 1999/02/23 02:56:04 ross Exp $ */
|
||||
/* $NetBSD: sched.h,v 1.2 1999/02/28 18:14:58 ross Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -92,7 +92,7 @@
|
|||
int schedhz; /* ideally: 16 */
|
||||
|
||||
#ifdef _SYS_PROC_H_
|
||||
void schedclk __P((struct proc *p));
|
||||
void schedclock __P((struct proc *p));
|
||||
static __inline void scheduler_fork_hook __P((
|
||||
struct proc *parent, struct proc *child));
|
||||
static __inline void scheduler_wait_hook __P((
|
||||
|
|
Loading…
Reference in New Issue