diff options
author | jhb <jhb@FreeBSD.org> | 2000-09-15 22:00:23 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-09-15 22:00:23 +0000 |
commit | 6aa22e71891d9536cd38c52ba42d3cbab6267464 (patch) | |
tree | dd693b4affb488258dbfa957d5c9ac0e4b88080d | |
parent | 8b1e8bae5a48e043601dd80357287498f4a1289e (diff) | |
download | FreeBSD-src-6aa22e71891d9536cd38c52ba42d3cbab6267464.zip FreeBSD-src-6aa22e71891d9536cd38c52ba42d3cbab6267464.tar.gz |
- 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.
-rw-r--r-- | sys/amd64/isa/ithread.c | 1 | ||||
-rw-r--r-- | sys/i386/isa/ithread.c | 1 | ||||
-rw-r--r-- | sys/kern/kern_idle.c | 1 | ||||
-rw-r--r-- | sys/sys/proc.h | 3 | ||||
-rw-r--r-- | sys/vm/vm_meter.c | 3 |
5 files changed, 8 insertions, 1 deletions
diff --git a/sys/amd64/isa/ithread.c b/sys/amd64/isa/ithread.c index 9e6b41e..f8326ea 100644 --- a/sys/amd64/isa/ithread.c +++ b/sys/amd64/isa/ithread.c @@ -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; diff --git a/sys/i386/isa/ithread.c b/sys/i386/isa/ithread.c index 9e6b41e..f8326ea 100644 --- a/sys/i386/isa/ithread.c +++ b/sys/i386/isa/ithread.c @@ -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; diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index b7d7031..b6aa0c0 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -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; } } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index edc2cd2..d504aba 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -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 */ diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 0f584c8..8b68a65 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -85,6 +85,9 @@ loadav(struct loadavg *avg) continue; /* FALLTHROUGH */ case SRUN: + if ((p->p_flag & P_NOLOAD) != 0) + continue; + /* FALLTHROUGH */ case SIDL: nrun++; } |