From owner-freebsd-hackers Sat Jul 13 14: 1: 0 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC16F37B400 for ; Sat, 13 Jul 2002 14:00:58 -0700 (PDT) Received: from HAL9000.wox.org (12-233-156-170.client.attbi.com [12.233.156.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2695A43EA3 for ; Sat, 13 Jul 2002 14:00:51 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.wox.org (localhost [127.0.0.1]) by HAL9000.wox.org (8.12.3/8.12.3) with ESMTP id g6DL0btc000642; Sat, 13 Jul 2002 14:00:41 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.wox.org (8.12.3/8.12.3/Submit) id g6DL0akD000641; Sat, 13 Jul 2002 14:00:36 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sat, 13 Jul 2002 14:00:35 -0700 From: David Schultz To: Matthew Dillon Cc: Peter Wemm , Sean Kelly , hackers@FreeBSD.ORG Subject: Re: swapoff? Message-ID: <20020713210035.GA363@HAL9000.wox.org> Mail-Followup-To: Matthew Dillon , Peter Wemm , Sean Kelly , hackers@FreeBSD.ORG References: <20020713071911.GA1558@HAL9000.wox.org> <20020713073404.9869A3811@overcee.wemm.org> <20020713115746.GA2162@HAL9000.wox.org> <200207131636.g6DGaoqh081285@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200207131636.g6DGaoqh081285@apollo.backplane.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Matthew Dillon : > We are not going to be doing any sort of weighting. It's an idea whos > time has come... and gone again. It might have been useful 8 years ago > but it is not useful today. > > Also, please note that it is not possible to reverse-lookup a swap bitmap > block and get the VM object / page number. The OBJT_SWAP VM objects have > to be scanned to get the swap bitmap blocks. Nor does it make much sense > to try to 'record' the blocks somewhere, there could be hundreds of > thousands of blocks and memory is not normally a luxury in this situation. I'm aware of that. That's why swapoff is a harder project; it requires working at more levels of abstraction, not all of which I fully understand yet. At least most of the VM stuff is well-documented now. ;-) > All you need to do is prevent new blocks from being allocated from the > old swap device. Since the radix tree bitmap code cannot make a > distinction between devices the easiest way to do this is to simply > allocate all the free bits associated with the device (which you can do), > and prevent any existing allocated blocks from being freed from the > bitmap (which is a simple calculation) ... and of course mark the page > dirty again since its backing store is being ripped out from under it. This makes sense. I was originally thinking of marking the device as off-limits to new allocations, but I realize now why that would not work. As long as the logical swap blocks that correspond to the device are still fair game for the swap pager, swapdev_strategy will still have to swap out to the device. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message