From owner-freebsd-current@FreeBSD.ORG Thu Jun 2 14:04:48 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 12E5416A41C; Thu, 2 Jun 2005 14:04:48 +0000 (GMT) (envelope-from andy@siliconlandmark.com) Received: from lexi.siliconlandmark.com (lexi.siliconlandmark.com [209.69.98.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id B947143D1D; Thu, 2 Jun 2005 14:04:47 +0000 (GMT) (envelope-from andy@siliconlandmark.com) Received: from lexi.siliconlandmark.com (localhost [127.0.0.1]) by lexi.siliconlandmark.com (8.13.3/8.13.3) with ESMTP id j52E4hXw050996; Thu, 2 Jun 2005 10:04:43 -0400 (EDT) (envelope-from andy@siliconlandmark.com) Received: from localhost (andy@localhost) by lexi.siliconlandmark.com (8.13.3/8.13.3/Submit) with ESMTP id j52E4heT050993; Thu, 2 Jun 2005 10:04:43 -0400 (EDT) (envelope-from andy@siliconlandmark.com) X-Authentication-Warning: lexi.siliconlandmark.com: andy owned process doing -bs Date: Thu, 2 Jun 2005 10:04:43 -0400 (EDT) From: Andre Guibert de Bruet To: Alexander Leidinger In-Reply-To: <20050602153909.49ihh5ek8wgo4w80@netchild.homeip.net> Message-ID: <20050602100315.M42933@lexi.siliconlandmark.com> References: <200506021041.j52AfaQH003213@gw.catspoiler.org> <20050602153909.49ihh5ek8wgo4w80@netchild.homeip.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Information: Please contact the ISP for more information X-SL-MailScanner: Found to be clean X-SL-SpamCheck: not spam, SpamAssassin (score=-2.539, required 6, autolearn=not spam, AWL 0.06, BAYES_00 -2.60) X-MailScanner-From: andy@siliconlandmark.com Cc: Don Lewis , 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 14:04:48 -0000 On Thu, 2 Jun 2005, Alexander Leidinger wrote: > 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. I will try to produce patches tonight for this. Stay tuned! Cheers! Andy /* Andre Guibert de Bruet * 6f43 6564 7020 656f 2e74 4220 7469 6a20 */ /* Code poet / Sysadmin * 636f 656b 2e79 5320 7379 6461 696d 2e6e */ /* GSM: +1 734 846 8758 * 5520 494e 2058 6c73 7565 6874 002e 0000 */ /* WWW: siliconlandmark.com * Tormenting bytes since 1980. */