Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Feb 2002 11:08:30 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Kirk McKusick <mckusick@mckusick.com>
Cc:        Mike Silbersack <silby@silby.com>, Valentin Nechayev <netch@iv.nn.kiev.ua>, "David W. Chapman Jr." <dwcjr@inethouston.net>, stable@FreeBSD.ORG
Subject:   Re: Softupdates failure during buffer syncing at shutdown (was Re: cvs commit: src/sys/ufs/ffs ffs_softdep.c) 
Message-ID:  <200202211908.g1LJ8UK98232@apollo.backplane.com>
References:   <200202211243.g1LChpi21455@beastie.mckusick.com>

next in thread | previous in thread | raw e-mail | index | archive | help
    Great!  Thanks for tracking this down for us, Kirk, it would have
    taken me a lot longer.

    I don't want to mess around with the sysdaemon shutdown code so what
    I have done is incorporated the io_sync call into the shutdown code.
    Considering the potential complexity in softupdates I wait until
    normal flushing is as done as it is going to get (just in case
    softupdate's sync crashes or panics) and then I call bioops.io_sync in
    the remaining loop iterations.

    I have tested it and it works like a charm!  I now get:

	syncing disks... 110 21 16 14 13 12 11 11 11 11 11 11 11 
	done

    And, bang, on the 6th iteration after it can't sync any more it calls
    io_sync and its happy.

    This will be going into -current today and -stable in three days.


Index: kern/kern_shutdown.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_shutdown.c,v
retrieving revision 1.72.2.11
diff -u -r1.72.2.11 kern_shutdown.c
--- kern/kern_shutdown.c	4 Feb 2002 13:09:24 -0000	1.72.2.11
+++ kern/kern_shutdown.c	21 Feb 2002 18:52:03 -0000
@@ -257,6 +257,8 @@
 			if (nbusy < pbusy)
 				iter = 0;
 			pbusy = nbusy;
+			if (iter > 5 && bioops.io_sync)
+				(*bioops.io_sync)(NULL);
 			sync(&proc0, NULL);
 			DELAY(50000 * iter);
 		}

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

:I have had an opportunity to log into test1.backplane.com to look
:at the problem (thanks to the wireless network at the conference
:here in Helsinki :-) The buffers that are being held locked
:contain the indirect block pointers for files that are to be
:...
:syncer daemon has been stopped. They will be used and freed
:if the syncer daemon is permitted to run. I am not sure what
:...
:                /*
:                 * Do soft update processing.
:                 */
:                if (bioops.io_sync)
:                        (*bioops.io_sync)(NULL);
:
:This call needs to be done after all the other buffers have been
:written as the writes of some of the other buffers cause the
:deletes related to these buffers to be put on the soft updates
:...
:	Kirk McKusick

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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