From owner-freebsd-current@FreeBSD.ORG Thu Jun 2 10:46:10 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 3801616A41C; Thu, 2 Jun 2005 10:46:10 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from postfix3-1.free.fr (postfix3-1.free.fr [213.228.0.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9B8F43D4C; Thu, 2 Jun 2005 10:46:09 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (vol75-8-82-233-239-98.fbx.proxad.net [82.233.239.98]) by postfix3-1.free.fr (Postfix) with ESMTP id 5B2C11734CD; Thu, 2 Jun 2005 12:46:08 +0200 (CEST) Received: by tatooine.tataz.chchile.org (Postfix, from userid 1000) id 413E7407E; Thu, 2 Jun 2005 12:45:59 +0200 (CEST) Date: Thu, 2 Jun 2005 12:45:59 +0200 From: Jeremie Le Hen To: Don Lewis Message-ID: <20050602104559.GR54337@obiwan.tataz.chchile.org> References: <20050601211542.G41030@lexi.siliconlandmark.com> <200506020637.j526bqXO002547@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506020637.j526bqXO002547@gw.catspoiler.org> User-Agent: Mutt/1.5.9i Cc: 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 10:46:10 -0000 Hi Don, hi all, > I just thought of a case where this might not work. It is possible to > create a swap-backed md, use it to back a file system, add a bunch of > swap, and then fill the file system, consuming the swap space. if you > do the cleanup processing in reverse order, the first operation would be > to remove the swap device, which you might not be able to do because of > a lack of RAM and alternate swap space. I am maybe missing something, but at time of shutdown when filesystems are going to be unmounted, I think user processes don't exist any longer. Do kernel threads consume so much memory sometimes that they won't fit in RAM ? > [...] > Taking care of the md's first is a good idea for the sake of efficiency, > because it eliminates the need to page in any of their contents that > have been paged out to swap. The problem is that if they are used to > back file systems, any dependent file systems must be unmounted first, > and that might not be possible if one of the dependent file systems > contains a swap file. An example would be using an md to back /tmp, > mounting /dev/adXXX on /tmp/foo, and adding /tmp/foo/swapfile as a swap > device. It might not be possible to clean up this arrangement at > shutdown without deadlocking. > > If a dependency tree is maintained, it should be possible prevent the > troublesome cases from happening. If swapping to a swap-backed md or > swapping to vnode-backed md that resides in a file system that is > dependent on a file system that resides on a swap-backed md are > forbidden, I think that is sufficient to prevent deadlock. Does the suppression a warning at shutdown (devfs) really needs to lead to a feature diminution ? This might appear overkill. Although such setups you describe seems to be slightly useless, we can imagine that, in the future, resources restrictions may be applied to jails and this would allow to set a vnode-backed swap partition for each jail. I'm not sure at all if this is going to happen someday, but I just wanted to point out that removing a feature now for this purpose could be a problem in the future/ Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >