1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Allow interrupt threads to run during shutdown. This should fix the

"dirty buffers during shutdown" problem introduced by the SMPng commit.

Submitted by:	tegge, cg
This commit is contained in:
Jason Evans 2000-09-10 23:06:50 +00:00
parent 6737f02e97
commit 62820f25f5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65707

View File

@ -219,7 +219,8 @@ boot(int howto)
*/
if (!cold && (howto & RB_NOSYNC) == 0 && waittime < 0) {
register struct buf *bp;
int iter, nbusy;
int iter, nbusy, pbusy;
int subiter;
waittime = 0;
printf("\nsyncing disks... ");
@ -231,7 +232,7 @@ boot(int howto)
* written will be remarked as dirty until other
* buffers are written.
*/
for (iter = 0; iter < 20; iter++) {
for (iter = pbusy = 0; iter < 20; iter++) {
nbusy = 0;
for (bp = &buf[nbuf]; --bp >= buf; ) {
if ((bp->b_flags & B_INVAL) == 0 &&
@ -246,7 +247,19 @@ boot(int howto)
if (nbusy == 0)
break;
printf("%d ", nbusy);
if (nbusy < pbusy)
iter = 0;
pbusy = nbusy;
sync(&proc0, NULL);
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");