Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 23:52:18 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        David Schultz <dschultz@uclink.Berkeley.EDU>
Cc:        Sean Kelly <smkelly@zombie.org>, hackers@FreeBSD.ORG
Subject:   Re: swapoff?
Message-ID:  <200207130652.g6D6qI93076722@apollo.backplane.com>
References:  <20020713040247.GA82181@edgemaster.zombie.org> <20020713052337.GA662@HAL9000.wox.org> <20020713053236.GA884@HAL9000.wox.org>

next in thread | previous in thread | raw e-mail | index | archive | help

:BTW, NetBSD's new UVM code has the ability to do this.  Perhaps
:it's worth looking in to how difficult it would really be in FreeBSD...
:
:To Unsubscribe: send mail to majordomo@FreeBSD.org
:with "unsubscribe freebsd-hackers" in the body of the message

    Someone got it mostly working a year or two ago if I remember right
    but I don't know what happened to it finally.

    Implementing swapoff is a bunch of grunt-work but not too hard in
    concept.  Basically the work involved is this:

	* 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.

	* Allocate all the free bitmap bits related to the swap device you
	  are trying to remove to prevent pageouts to the device you are
	  removing.

	* Flag the swap device being removed and then scan all OBJT_SWAP
	  VM Objects looking for swap blocks associated with the device,
	  and force a page-in of those blocks.  The getpages code for the
	  swap backing store would detect the flag and not clear the swap
	  bitmap bits as it pages-in the data.

	  (Forcing a pagein may force pages to cycle back out to another
	  swap device, so special treatment of the paged-in pages (like
	  immediately placing it in the VM page cache instead of the 
	  active or inactive queues) is necessary to reduce load effects
	  on the system.

	* The swap device being removed can now be closed and the related
	  swap device index marked free.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207130652.g6D6qI93076722>