- Add a new process flag P_NOLOAD that marks a process that should be

ignored during load average calcuations.
- Set this flag for the idle processes and the softinterrupt process.
This commit is contained in:
John Baldwin 2000-09-15 22:00:23 +00:00
parent 5cd95fe8d5
commit 7ab37af1ed
5 changed files with 8 additions and 1 deletions

View File

@ -299,6 +299,7 @@ start_softintr(void *dummy)
p->p_rtprio.type = RTP_PRIO_ITHREAD;
p->p_rtprio.prio = PI_SOFT; /* soft interrupt */
p->p_stat = SWAIT; /* we're idle */
p->p_flag |= P_NOLOAD;
/* Put in linkages. */
softintr->it_proc = p;

View File

@ -299,6 +299,7 @@ start_softintr(void *dummy)
p->p_rtprio.type = RTP_PRIO_ITHREAD;
p->p_rtprio.prio = PI_SOFT; /* soft interrupt */
p->p_stat = SWAIT; /* we're idle */
p->p_flag |= P_NOLOAD;
/* Put in linkages. */
softintr->it_proc = p;

View File

@ -65,6 +65,7 @@ idle_setup(void *dummy)
if (error)
panic("idle_setup: kthread_create error %d\n", error);
gd->gd_idleproc->p_flag |= P_NOLOAD;
gd->gd_idleproc->p_stat = SRUN;
}
}

View File

@ -266,7 +266,7 @@ struct proc {
#define SSLEEP 3 /* Sleeping on an address. */
#define SSTOP 4 /* Process debugging or suspension. */
#define SZOMB 5 /* Awaiting collection by parent. */
#define SWAIT 6 /* Waiting for interrupt or CPU. */
#define SWAIT 6 /* Waiting for interrupt. */
#define SMTX 7 /* Blocked on a mutex. */
/* These flags are kept in p_flags. */
@ -284,6 +284,7 @@ struct proc {
#define P_WAITED 0x01000 /* Debugging process has waited for child. */
#define P_WEXIT 0x02000 /* Working on exiting. */
#define P_EXEC 0x04000 /* Process called exec. */
#define P_NOLOAD 0x08000 /* Ignore during load avg calculations. */
/* Should probably be changed into a hold count. */
/* was P_NOSWAP 0x08000 was: Do not swap upages; p->p_hold */

View File

@ -85,6 +85,9 @@ loadav(struct loadavg *avg)
continue;
/* FALLTHROUGH */
case SRUN:
if ((p->p_flag & P_NOLOAD) != 0)
continue;
/* FALLTHROUGH */
case SIDL:
nrun++;
}