From owner-freebsd-current@FreeBSD.ORG Thu Jun 2 07:43:46 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD9CB16A41C; Thu, 2 Jun 2005 07:43:46 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D39F43D48; Thu, 2 Jun 2005 07:43:45 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from fwd17.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1DdkMi-0004Wx-00; Thu, 02 Jun 2005 09:43:44 +0200 Received: from Andro-Beta.Leidinger.net (GM6GJcZGoeoxeZO7xVRquRRAlG9nWND4F2UKuX3nDyP7un0C9NjO8v@[84.165.199.14]) by fwd17.sul.t-online.de with esmtp id 1DdkMY-1VgB1M0; Thu, 2 Jun 2005 09:43:34 +0200 Received: from localhost (localhost [127.0.0.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id j527hXit039446; Thu, 2 Jun 2005 09:43:33 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from 141.113.101.32 ([141.113.101.32]) by netchild.homeip.net (Horde MIME library) with HTTP for ; Thu, 02 Jun 2005 09:43:32 +0200 Message-ID: <20050602094332.949xldwlwk4c8k4g@netchild.homeip.net> X-Priority: 3 (Normal) Date: Thu, 02 Jun 2005 09:43:32 +0200 From: Alexander Leidinger To: Don Lewis References: <200506020637.j526bqXO002547@gw.catspoiler.org> In-Reply-To: <200506020637.j526bqXO002547@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) / FreeBSD-4.11 X-ID: GM6GJcZGoeoxeZO7xVRquRRAlG9nWND4F2UKuX3nDyP7un0C9NjO8v@t-dialin.net X-TOI-MSGID: 6afe4f8e-97f5-4dfe-a628-34decd9a0c0f Cc: phk@phk.freebsd.dk, current@FreeBSD.org Subject: Re: [RFC] [PATCH] VM & VFS changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2005 07:43:46 -0000 Don Lewis 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 @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ 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!!