From febe98ab987ed825ad33e6021d93952ba1a00eb5 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 19 Jul 2002 21:06:01 +0000 Subject: [PATCH] Set P_NOLOAD on the pagezero kthread so that it doesn't artificially skew the loadav. This is not real load. If you have a nice process running in the background, pagezero may sit in the run queue for ages and add one to the loadav, and thereby affecting other scheduling decisions. --- sys/vm/vm_zeroidle.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c index 46db4e7901d7..a239cfa90374 100644 --- a/sys/vm/vm_zeroidle.c +++ b/sys/vm/vm_zeroidle.c @@ -107,17 +107,23 @@ vm_page_zero_idle_wakeup(void) static void vm_pagezero(void) { - struct thread *td = curthread; + struct thread *td; + struct proc *p; struct rtprio rtp; int pages = 0; int pri; + td = curthread; + p = td->td_proc; rtp.prio = RTP_PRIO_MAX; rtp.type = RTP_PRIO_IDLE; mtx_lock_spin(&sched_lock); rtp_to_pri(&rtp, td->td_ksegrp); pri = td->td_priority; mtx_unlock_spin(&sched_lock); + PROC_LOCK(p); + p->p_flag |= P_NOLOAD; + PROC_UNLOCK(p); for (;;) { if (vm_page_zero_check()) {