From owner-freebsd-current@FreeBSD.ORG Thu Jun 2 13:39:17 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 55D4C16A41C; Thu, 2 Jun 2005 13:39:17 +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 AE73F43D1D; Thu, 2 Jun 2005 13:39:16 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from fwd19.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1Ddpul-0004hp-01; Thu, 02 Jun 2005 15:39:15 +0200 Received: from Andro-Beta.Leidinger.net (r9UDggZOge0wCQtFK1Xkbd08r16Jj6xfI8414vpYMRYeT3F+jwDfgz@[84.165.198.7]) by fwd19.sul.t-online.de with esmtp id 1Ddpuh-1j1sES0; Thu, 2 Jun 2005 15:39:11 +0200 Received: from localhost (localhost [127.0.0.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id j52Dd9QL005498; Thu, 2 Jun 2005 15:39:09 +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 15:39:09 +0200 Message-ID: <20050602153909.49ihh5ek8wgo4w80@netchild.homeip.net> X-Priority: 3 (Normal) Date: Thu, 02 Jun 2005 15:39:09 +0200 From: Alexander Leidinger To: Don Lewis References: <200506021041.j52AfaQH003213@gw.catspoiler.org> In-Reply-To: <200506021041.j52AfaQH003213@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: r9UDggZOge0wCQtFK1Xkbd08r16Jj6xfI8414vpYMRYeT3F+jwDfgz@t-dialin.net X-TOI-MSGID: 7b4be38d-da40-461b-b489-e1b79ed5fd91 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 13:39:17 -0000 Don Lewis wrote: >> What am I overlooking? > > Create a large, but nearly empty file system, /a ^ memory/swap based > Mount a file system backed by a physical disk on /a/b > Create the file /a/b/c and configure it to be used as swap > Write a large amount of data to the file /a/d, which will overflow RAM > and be paged out to /a/b/c > > It won't be possible to disable swapping to /a/b/c because there is not > sufficient RAM to page in the data stored there. It won't be possible > to unmount /a/b because /a/b/c is busy. It won't be possible to unmount > /a because it is busy because /a/b is mounted on it. Ah! Yes! I tend to forget this is possible. In my mind a memory/swap based FS as a "leaf" in the directory tree... or more correctly, the subtree below the memory/swap based FS isn't allowed to contain a mointpoint of a non memory/swap based FS. Any other use which may require to break this rule has to use symlinks instead and isn't allowed to break the rule. This helps to avoid some pitfalls. > If the dependencies are tracked so that this configuration (swapping to > anything that is directly or indirectly dependent on a swap-backed file > system) can be forbidden, then either the algorithm that I suggested, or I'm not sure if we should enforce this policy... I like it, but I think such a restriction should be configurable via sysctl (enabled by default). > your iterative algorithm should work. Your algorithm could even be > simplified by pulling the swap-off out of the loop. > > unconfigure md's that are not busy > do { > foreach filesystem in reverse(mountlist) { > unmount filesystem > if (success and backed by md) > unconfigure md /* either swap or vnode backed */ > } > } while (progress) > swap-off > do { > foreach filesystem in reverse(mountlist) { > unmount filesystem > if (success and backed by md) > unconfigure md /* only vnode backed remain */ > } > } while (progress) > > Removing the swap-off from the loop may avoid a lot of paging activity > because all the paged-out data from swap backed md's will be discarded > before swap is disabled. Sounds even better. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 Get forgiveness now -- tomorrow you may no longer feel guilty.