diff --git a/sys/amd64/isa/ithread.c b/sys/amd64/isa/ithread.c index 9e6b41e1a79..f8326eaa2b6 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 9e6b41e1a79..f8326eaa2b6 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 b7d70314fb7..b6aa0c0e7dc 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 edc2cd22269..d504aba7bbe 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 0f584c86ae2..8b68a65c6d7 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++; }