Date: Mon, 7 Oct 2002 17:17:03 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Terry Lambert <tlambert2@mindspring.com> Cc: Wilko Bulte <wkb@freebie.xs4all.nl>, Peter Wemm <peter@wemm.org>, Mikhail Teterin <mi+mx@aldan.algebra.com>, arch@FreeBSD.ORG Subject: Re: swapon some regular file Message-ID: <200210080017.g980H3Dl049578@apollo.backplane.com> References: <20021007212545.C363B2A88D@canning.wemm.org> <3DA204A7.50530BE5@mindspring.com> <20021008000656.A598@freebie.xs4all.nl> <3DA20F40.D3C3FD59@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
The translation overhead isn't a major problem. What is a
major problem is the fact that having to do a translation
may require additional I/O's... in fact, may require additional
memory allocations. Since pageouts usually occur when memory
is low, the additional I/O can lead to a deadlock in the paging
system.
So the OS would definitely need to preallocate and record the
physical block numbers / number ranges related to the new swap area.
This is just as well since you can't safely use a sparse file to
back the swap area anyway. Since pageouts are essentially random,
the underlying file blocks would be allocated non deterministically
and the result would be a mess of seeks and no ability to cluster
anything.
This is easy to demonstrate with VN. You can back a VN disk with
a pre-allocated file, with a sparse file, with pre-reserved swap,
or with sparse swap. The performance of VN disks created with sparse
files or swap tend to degrade rather quickly due to the severe
randomness in the seeking that winds up happening.
-Matt
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210080017.g980H3Dl049578>
