From owner-freebsd-current Fri Sep 22 5:12:40 2000 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 98C6637B424; Fri, 22 Sep 2000 05:12:35 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id XAA12088; Fri, 22 Sep 2000 23:12:17 +1100 Date: Fri, 22 Sep 2000 23:12:13 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Takaya Ogawa Cc: current@FreeBSD.ORG, jasone@FreeBSD.ORG Subject: Re: new idle_proc() makes my laptop very hot In-Reply-To: <867l85y9sr.wl@triaez.kaisei.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 22 Sep 2000, Takaya Ogawa wrote: > Attached patch adds back the HLT in i386 UP case and > seems to fix my problem, although I'm totally > unfamiliar with SMP nor alpha. This has the race bug that was fixed in rev.1.88 of swtch.s. I use the folowing fix. It also fixes the loss of page cleaning in the idle routine. It hasn't been committed mainly because idle page cleaning hasn't been tested for the SMP case or implemented for alphas (the alpha's vm_page_zero_idle() has apparently never been used). Most of the #include changes are unrelated. They are wrong fixes for spam in . diff -c2 kern_idle.c~ kern_idle.c *** kern_idle.c~ Sun Sep 17 04:27:14 2000 --- kern_idle.c Sun Sep 17 23:07:41 2000 *************** *** 29,34 **** #include #include - #include #include #include --- 29,41 ---- #include #include + #ifdef __i386__ /* XXX */ + #ifdef SMP + #include + #endif + #include + #include + #include + #endif #include #include *************** *** 40,43 **** --- 47,52 ---- #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) *************** *** 84,88 **** --- 93,107 ---- 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 *************** *** 93,96 **** --- 112,118 ---- " for a process"); } + #ifdef __i386__ + enable_intr(); + #endif mtx_enter(&sched_lock, MTX_SPIN); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message