Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2017 20:41:29 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Leak in file backed swap
Message-ID:  <ED274570-D235-4AE9-B429-38E051B2F5F3@dsl-only.net>

next in thread | raw e-mail | index | archive | help
Giulio Ferro auryn at zirakzigil.org wrote on Thu Feb 2 15:05:11 UTC 2017
of problems with a file system based swap space (a swap file).

FYI:

See Bugzilla 206048 and its Comment #7 in particular,
that quotes Konstantin Belousov from an arm list
submittal. (Repeated later below.) Many folks in many
environments have observed lock ups for files used as
swap space, UFS files included (without any ZFS present).

Comment #3 from Tom Vijlbrief reported:

stress -d 2 -m 3 --vm-keep

or the like will hang up. (He listed a 1 GByte RAM
and 1 GByte swapfile as an example context for
hanging during linking of the kernel.)


On 2017-Feb-13, at 7:20 PM, Konstantin Belousov <kostikbel
at gmail.com> wrote on the freebsd-arm list:

. . .

swapfile write requires the write request to come through the filesystem
write path, which might require the filesystem to allocate more memory
and read some data. E.g. it is known that any ZFS write request
allocates memory, and that write request on large UFS file might require
allocating and reading an indirect block buffer to find the block number
of the written block, if the indirect block was not yet read.

As result, swapfile swapping is more prone to the trivial and unavoidable
deadlocks where the pagedaemon thread, which produces free memory, needs
more free memory to make a progress.  Swap write on the raw partition over
simple partitioning scheme directly over HBA are usually safe, while e.g.
zfs over geli over umass is the worst construction.




===
Mark Millard
markmi  at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ED274570-D235-4AE9-B429-38E051B2F5F3>