From owner-freebsd-current Sun Sep 10 17:49:49 2000 Delivered-To: freebsd-current@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id D971437B422 for ; Sun, 10 Sep 2000 17:49:46 -0700 (PDT) Received: (from jhb@localhost) by pike.osd.bsdi.com (8.9.3/8.9.3) id RAA28932; Sun, 10 Sep 2000 17:49:07 -0700 (PDT) (envelope-from jhb) From: John Baldwin Message-Id: <200009110049.RAA28932@pike.osd.bsdi.com> Subject: Re: Dirty buffers on reboot.. In-Reply-To: <200009090208.EAA69984@midten.fast.no> from "Tor.Egge@fast.no" at "Sep 9, 2000 04:08:22 am" To: Tor.Egge@fast.no Date: Sun, 10 Sep 2000 17:49:07 -0700 (PDT) Cc: current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Tor.Egge@fast.no wrote: > > Ok, an update on the dirty buffers on reboot: > > > > If you use the reboot command, you will get dirty buffers. If you use > > 'shutdown -r now' instead, you won't get dirty buffers. Thus, as a workaround > > for now, use the shutdown command to reboot your box until we can track this > > down. > > I suggest using some method to allow interrupt threads to run during > the shutdown. Perhaps the current process priority should be elevated > so it is guaranteed to be scheduled after the last interrupt thread > instead of some unrelated process. > > Index: kern_shutdown.c > =================================================================== > RCS file: /home/ncvs/src/sys/kern/kern_shutdown.c,v > retrieving revision 1.80 > diff -u -r1.80 kern_shutdown.c > --- kern_shutdown.c 2000/09/07 01:32:51 1.80 > +++ kern_shutdown.c 2000/09/09 01:42:20 > @@ -220,6 +220,7 @@ > if (!cold && (howto & RB_NOSYNC) == 0 && waittime < 0) { > register struct buf *bp; > int iter, nbusy; > + int subiter; > > waittime = 0; > printf("\nsyncing disks... "); > @@ -247,7 +248,18 @@ > break; > printf("%d ", nbusy); > sync(&proc0, NULL); > - DELAY(50000 * iter); > + > + if (curproc != NULL) { curproc is never NULL anymore, so the if statement can be removed. > + for (subiter = 0; subiter < 50 * iter; subiter++) { > + mtx_enter(&sched_lock, MTX_SPIN); > + setrunqueue(curproc); > + mi_switch(); /* Allow interrupt threads to run */ > + mtx_exit(&sched_lock, MTX_SPIN); > + DELAY(1000); > + } > + } else > + DELAY(50000 * iter); > + > } > printf("\n"); > /* > > - Tor Egge > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message