Re: [RFC] [PATCH] VM & VFS changes

From: Alexander Leidinger <Alexander_at_Leidinger.net>
Date: Thu, 02 Jun 2005 09:43:32 +0200
Don Lewis <truckman_at_FreeBSD.org> wrote:

>>>>> Wouldn't a loop like the following be enough?
>>>>> while swap
>>>>>     umount unbusy-FS
>>>>>     swap-off swap
>>>>>
>>>>> This assumes that swap-off doesn't turns off the swap if it isn't 
>>>>> able to put
>>>>> everything back into other swap or physical RAM areas.

> I think this can be unwound in one pass if a list of the dependency
> pairs is kept and then properly sorted before processing.  The types of
> dependencies are:
> 	md depends on file system (vnode backed md)
> 	md depends on swap (swap backed file system)
> 	file system depends on md (md backed file system)
> 	swap depends on md (swap on an md)
> 	file system depends on file system (mount relationship)
> First undo any dependencies that ultimately depend on swap, unconfigure
> the swap devices, and finally undo any dependencies that swap depended
> on.

I still don't understand why my approach above doesn't solve this problem.

A FS is busy when something is still open. So if the FS is used as a
container for swap, the FS is busy and it isn't supposed to be umounted. If
a md is configured on the swap area you want to disable with swap-off, my
above description allows the call to fail. Since the md/swap/FS part is
cycle-free, we have an upper bound of sum(#md)+sum(#swap)+sum(#FS)
iterations (actually it's less than that, but my point is: a linear number
of iterations with an upper bound) of this loop. When the loop finishes, no
swap is enabled anymore. -> Goal reached.

What am I overlooking?

Bye,
Alexander.

-- 
http://www.Leidinger.net  Alexander _at_ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild _at_ FreeBSD.org  : PGP ID = 72077137
Hiccuping & trembling into the WASTE DUMPS of New Jersey like some
drunken CABBAGE PATCH DOLL, coughing in line at FIORUCCI'S!!
Received on Thu Jun 02 2005 - 05:43:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:35 UTC