On Mon, 16 Apr 2012, Mel Gorman wrote: > Changelog since V2 > o Nothing significant, just rebases. A radix tree lookup is replaced with > a linear search would be the biggest rebase artifact > > This patch series is based on top of "Swap-over-NBD without deadlocking v9" > as it depends on the same reservation of PF_MEMALLOC reserves logic. > > When a user or administrator requires swap for their application, they > create a swap partition and file, format it with mkswap and activate it with > swapon. In diskless systems this is not an option so if swap if required > then swapping over the network is considered. The two likely scenarios > are when blade servers are used as part of a cluster where the form factor > or maintenance costs do not allow the use of disks and thin clients. > > The Linux Terminal Server Project recommends the use of the Network > Block Device (NBD) for swap but this is not always an option. There is > no guarantee that the network attached storage (NAS) device is running > Linux or supports NBD. However, it is likely that it supports NFS so there > are users that want support for swapping over NFS despite any performance > concern. Some distributions currently carry patches that support swapping > over NFS but it would be preferable to support it in the mainline kernel. > > Patch 1 avoids a stream-specific deadlock that potentially affects TCP. > > Patch 2 is a small modification to SELinux to avoid using PFMEMALLOC > reserves. > > Patch 3 adds three helpers for filesystems to handle swap cache pages. > For example, page_file_mapping() returns page->mapping for > file-backed pages and the address_space of the underlying > swap file for swap cache pages. > > Patch 4 adds two address_space_operations to allow a filesystem > to pin all metadata relevant to a swapfile in memory. Upon > successful activation, the swapfile is marked SWP_FILE and > the address space operation ->direct_IO is used for writing > and ->readpage for reading in swap pages. > > Patch 5 notes that patch 3 is bolting > filesystem-specific-swapfile-support onto the side and that > the default handlers have different information to what > is available to the filesystem. This patch refactors the > code so that there are generic handlers for each of the new > address_space operations. > > Patch 6 adds an API to allow a vector of kernel addresses to be > translated to struct pages and pinned for IO. > > Patch 7 updates NFS to use the helpers from patch 3 where necessary. > > Patch 8 avoids setting PF_private on PG_swapcache pages within NFS. > > Patch 9 implements the new swapfile-related address_space operations > for NFS and teaches the direct IO handler how to manage > kernel addresses. > > Patch 10 prevents page allocator recursions in NFS by using GFP_NOIO > where appropriate. > > Patch 11 fixes a NULL pointer dereference that occurs when using > swap-over-NFS. > > With the patches applied, it is possible to mount a swapfile that is on an > NFS filesystem. Swap performance is not great with a swap stress test taking > roughly twice as long to complete than if the swap device was backed by NBD. > FWIW, I'd like to see these go in, I use them for giving ARM boards with NFS root file systems swap space. I have tested these with an artificial swap benchmark and with a large project compile on a beagle board. They work great for me. Tested-by: Eric B Munson <emunson@xxxxxxxxx>
Attachment:
signature.asc
Description: Digital signature