From owner-freebsd-hackers Sat Jul 13 0:19:17 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 9D3C137B400 for ; Sat, 13 Jul 2002 00:19:15 -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 114E843E4A for ; Sat, 13 Jul 2002 00:19:15 -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 g6D7JNf3001599; Sat, 13 Jul 2002 00:19:23 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.wox.org (8.12.3/8.12.3/Submit) id g6D7JCXS001598; Sat, 13 Jul 2002 00:19:12 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sat, 13 Jul 2002 00:19:11 -0700 From: David Schultz To: Matthew Dillon Cc: Sean Kelly , hackers@FreeBSD.ORG Subject: Re: swapoff? Message-ID: <20020713071911.GA1558@HAL9000.wox.org> Mail-Followup-To: Matthew Dillon , Sean Kelly , hackers@FreeBSD.ORG References: <20020713040247.GA82181@edgemaster.zombie.org> <20020713052337.GA662@HAL9000.wox.org> <20020713053236.GA884@HAL9000.wox.org> <200207130652.g6D6qI93076722@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200207130652.g6D6qI93076722@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 : > Implementing swapoff is a bunch of grunt-work but not too hard in > concept. Basically the work involved is this: Sounds like a plan, and not too tricky. Perhaps I'll see if I can figure it out when I have some free time. > * Make a calculation to be sure that it is possible to turn off > the swap device and not run the system out of VM. If it is not > possible do not allow the swapoff. Can't you have a race condition here where you decide that you have enough space, and by the time you've deallocated half of the swapfile that's no longer the case? It seems like the correct thing to do in that case is abort the system call (which could be painful). Perhaps the best thing to do in this case is wait for vm_pageout_scan to kill a few pigs. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message