From owner-freebsd-current@FreeBSD.ORG Fri Jun 4 09:35:27 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81FFF16A4CE for ; Fri, 4 Jun 2004 09:35:27 -0700 (PDT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 598D443D39 for ; Fri, 4 Jun 2004 09:35:27 -0700 (PDT) (envelope-from nate@root.org) Received: (qmail 50766 invoked by uid 1000); 4 Jun 2004 16:35:12 -0000 Date: Fri, 4 Jun 2004 09:35:12 -0700 (PDT) From: Nate Lawson To: John Baldwin In-Reply-To: <200406041108.33170.jhb@FreeBSD.org> Message-ID: <20040604093428.O50710@root.org> References: <714DBA6C-B565-11D8-B32B-000393AB07D8@verizon.net> <20040604105118.kpsgwcg4skgsgso0@www.sweetdreamsracing.biz> <200406041108.33170.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Kenneth Culver cc: freebsd-current@FreeBSD.org cc: Dan Nelson cc: David Gurvich Subject: Re: reboot or shutdown not working with -current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2004 16:35:27 -0000 On Fri, 4 Jun 2004, John Baldwin wrote: > On Friday 04 June 2004 10:51 am, Kenneth Culver wrote: > > Quoting John Baldwin : > > > On Thursday 03 June 2004 11:04 am, Dan Nelson wrote: > > >> In the last episode (Jun 03), David Gurvich said: > > >> > Recent cvsup has caused system to hang on reboot or shutdown, > > >> > occasionally hangs on startup with detection of optical drive on 2nd > > >> > ide. Anyone know how to get system logs in this situation? > > >> > Motherboard is ASUS A7N266-VM. System worked reasonably with APIC > > >> > turned off 5/26/2004. > > >> > > >> Back out sys/i386/i386/intr_machdep.c rev 1.6. > > > > > > Or for the real fix, try this: > > > > > > Index: acpi_cpu.c > > > =================================================================== > > > RCS file: /usr/cvs/src/sys/dev/acpica/acpi_cpu.c,v > > > retrieving revision 1.36 > > > diff -u -r1.36 acpi_cpu.c > > > --- acpi_cpu.c 7 May 2004 05:22:37 -0000 1.36 > > > +++ acpi_cpu.c 4 Jun 2004 14:44:33 -0000 > > > @@ -376,8 +376,7 @@ > > > > > > /* Wait for all processors to exit acpi_cpu_idle(). */ > > > smp_rendezvous(NULL, NULL, NULL, NULL); > > > - while (cpu_idle_busy > 0) > > > - DELAY(1); > > > + DELAY(1); > > > > > > return_VALUE (0); > > > } > > > > You know that the reboot problems go away when > > /usr/src/sys/i386/i386/intr_machdep.c is reverted from 1.16 to 1.15 right? > > Yes, because the real bug is above. Disabling interrupt preemption just masks > it. The gory details are that almost all (in fact on UP, 100%) of context > switches away from the idlethread are due to interrupts. When interrupt > preemption is enabled, this means that idle threads are switched away from > before they've had a chance to decrement the cpu_idle_busy counter in > acpi_cpu_idle(). Thus, when the thread doing shutdown gets to this loop, it > never terminates because the idlethread of the CPU executing the shutdown > request never gets a chance to go back and decrement its idle_busy count. In > truth, you don't actually need the loop, once you do the rendezvous, any > other CPUs that are idle will wake up, exit acpi_cpu_idle() and re-enter > after finding no runnable jobs. I tracked this down after a couple of hours > on Wednesday but was very busy with ${REALJOB} work yesterday and haven't had > a chance to send an e-mail out about this. I'm swamped too. Please commit a #if 0 around the while () until I can get to this. Thanks, Nate