summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_idle.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-10-17 23:12:37 +0000
committerjhb <jhb@FreeBSD.org>2000-10-17 23:12:37 +0000
commit94df07bcb48165dd44a53b14baeca48e2b0da863 (patch)
treeb877e54abb29d82e43fdcf8cb5326d0762e20755 /sys/kern/kern_idle.c
parent31c606939a660a9de8d00b6f751b86169ce3b4f5 (diff)
downloadFreeBSD-src-94df07bcb48165dd44a53b14baeca48e2b0da863.zip
FreeBSD-src-94df07bcb48165dd44a53b14baeca48e2b0da863.tar.gz
- Wrap the sanity checks for staying in the idle loop for absurdly long
amounts of time in #ifdef DIAGNOSTIC - Call vm_page_zero_idle() during the idle loop.
Diffstat (limited to 'sys/kern/kern_idle.c')
-rw-r--r--sys/kern/kern_idle.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c
index 3749fe9..343680f 100644
--- a/sys/kern/kern_idle.c
+++ b/sys/kern/kern_idle.c
@@ -28,18 +28,13 @@
#endif
#include <machine/cpu.h>
+#include <machine/md_var.h>
#include <machine/mutex.h>
#include <machine/smp.h>
#include <machine/globaldata.h>
#include <machine/globals.h>
-#ifdef SMP_DEBUG
-#include <sys/bus.h>
-#include <i386/isa/icu.h>
-#include <i386/isa/intr_machdep.h>
-#endif
-
static void idle_setup(void *dummy);
SYSINIT(idle_setup, SI_SUB_SCHED_IDLE, SI_ORDER_FIRST, idle_setup, NULL)
@@ -79,22 +74,33 @@ idle_setup(void *dummy)
static void
idle_proc(void *dummy)
{
+#ifdef DIAGNOSTIC
int count;
+#endif
for (;;) {
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef DIAGNOSTIC
count = 0;
while (count >= 0 && procrunnable() == 0) {
+#else
+ while (procrunnable() == 0) {
+#endif
/*
* This is a good place to put things to be done in
* the background, including sanity checks.
*/
+#ifdef DIAGNOSTIC
if (count++ < 0)
CTR0(KTR_PROC, "idle_proc: timed out waiting"
" for a process");
+#endif
+
+ if (vm_page_zero_idle() != 0)
+ continue;
/* call out to any cpu-becoming-idle events */
EVENTHANDLER_FAST_INVOKE(idle_event, count);
OpenPOWER on IntegriCloud