Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Sep 2000 04:08:22 +0200
From:      Tor.Egge@fast.no
To:        jhb@pike.osd.bsdi.com
Cc:        current@FreeBSD.ORG
Subject:   Re: Dirty buffers on reboot..
Message-ID:  <200009090208.EAA69984@midten.fast.no>
In-Reply-To: Your message of "Fri, 8 Sep 2000 12:42:18 -0700 (PDT)"
References:  <200009081942.MAA57127@pike.osd.bsdi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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) {
+			  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009090208.EAA69984>