Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2006 12:41:18 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_shutdown.c src/sys/vm swap_pager.c swap_pager.h
Message-ID:  <20060410104118.GD3728@garage.freebsd.pl>
In-Reply-To: <200604101003.k3AA3iMK023510@repoman.freebsd.org>
References:  <200604101003.k3AA3iMK023510@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--PHCdUe6m4AxPMzOu
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 10, 2006 at 10:03:41AM +0000, Pawel Jakub Dawidek wrote:
+> pjd         2006-04-10 10:03:41 UTC
+>=20
+>   FreeBSD src repository
+>=20
+>   Modified files:
+>     sys/kern             kern_shutdown.c=20
+>     sys/vm               swap_pager.c swap_pager.h=20
+>   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 =3D vfs_unmountall();
		if (n =3D=3D 0)
			break;
		n =3D swapoff_all();
		if (n =3D=3D 0)
			break;
	}

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--PHCdUe6m4AxPMzOu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFEOjZOForvXbEpPzQRAhZIAKDWrQz4r8U42iElBZvM51z95dULfgCg1wAl
kXPitBaBT/lLl9BAugwS9po=
=oH9v
-----END PGP SIGNATURE-----

--PHCdUe6m4AxPMzOu--



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