cvs commit: src/sys/kern kern_shutdown.c src/sys/vm swap_pager.c swap_pager.h

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Apr 10 10:42:35 UTC 2006


On Mon, Apr 10, 2006 at 10:03:41AM +0000, Pawel Jakub Dawidek wrote:
+> pjd         2006-04-10 10:03:41 UTC
+> 
+>   FreeBSD src repository
+> 
+>   Modified files:
+>     sys/kern             kern_shutdown.c 
+>     sys/vm               swap_pager.c swap_pager.h 
+>   Log:
+>   On shutdown try to turn off all swap devices. This way GEOM providers are
+>   properly closed on shutdown.

The hard situation to solve is when we have, eg. file-backed md(4)
devices which we use as a swap device. We can also configure swap-backed
md(4) device and create and mount file system on it.

To solve such complex scenario we need to reimplement vfs_unmountall()
and swapoff_all() to return number of unmounted file system (removed
swap devices) and do something like:

	vfs_unmountall();
	swapoff_all();
	for (;;) {
		n = vfs_unmountall();
		if (n == 0)
			break;
		n = swapoff_all();
		if (n == 0)
			break;
	}

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20060410/5e3a9ca1/attachment.pgp


More information about the cvs-src mailing list