Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2000 23:24:03 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        Valentin Nechayev <netch@segfault.kiev.ua>, freebsd-current@FreeBSD.org
Subject:   Re: load average is 1 when no processes active; etc.
Message-ID:  <Pine.BSF.4.21.0009112319280.1193-100000@besplex.bde.org>
In-Reply-To: <39BCBE78.7D17B24B@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 11 Sep 2000, Maxim Sobolev wrote:

> Bruce Evans wrote:
> > Well, the kernel just doesn't treat it specially, so it gets counted in the
> > load average.  I'm not sure if the interrupt and other kernel processes
> > are counted.  Since they do useful work, they should be.  The idle process
> > does the not so useful work of heating the cpu, since it no longer halts
> > or runs vm_page_zero_idle().
> 
> BTW, will it be fixed any time soon? Mobile users will certainly like to see idle process
> halting CPU as it was before.

Not sure.  I use this quick fix:

---
diff -c2 kern_idle.c~ kern_idle.c
*** kern_idle.c~	Thu Sep  7 12:32:51 2000
--- kern_idle.c	Sun Sep 10 18:06:39 2000
***************
*** 40,43 ****
--- 50,55 ----
  #endif
  
+ extern void (*_hlt_vector)(void);
+ 
  static void idle_setup(void *dummy);
  SYSINIT(idle_setup, SI_SUB_SCHED_IDLE, SI_ORDER_FIRST, idle_setup, NULL)
***************
*** 90,94 ****
--- 102,116 ----
  		count = 0;
  
+ #ifdef __i386__
+ 		disable_intr();
+ #endif
  		while (count >= 0 && procrunnable() == 0) {
+ #ifdef __i386__
+ 			if (vm_page_zero_idle() != 0)
+ 				continue;
+ 			(*_hlt_vector)();
+ 			disable_intr();
+ 			continue;
+ #endif
  		/*
  		 * This is a good place to put things to be done in
***************
*** 99,102 ****
--- 121,127 ----
  				    " for a process");
  		}
+ #ifdef __i386__
+ 		enable_intr();
+ #endif
  
  		mtx_enter(&sched_lock, MTX_SPIN);
---

Add a bogus #include of <machine/md_var.h> to fix a warning.

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009112319280.1193-100000>