Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2001 07:35:54 +1100
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Swap performance (was: Getting rid of /usr file system)
Message-ID:  <20011220073554.Q73243@gsmx07.alcatel.com.au>
In-Reply-To: <200112161616.fBGGGKg49403@aslan.scsiguy.com>; from gibbs@scsiguy.com on Sun, Dec 16, 2001 at 09:16:20AM -0700
References:  <200112120510.fBC5AEM33040@harmony.village.org> <200112161616.fBGGGKg49403@aslan.scsiguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 16, 2001 at 09:16:20AM -0700, Justin T. Gibbs wrote:
>  I prefer to have my swap partition as close to the front
>of the disk as possible to take advantage of the faster tracks.

Is this particular piece of folklore still valid?

It used to be true:  When a process started, the text and data were
read from the filesystem into memory.  If necessary, the process was
paged/swapped to/from swap.  Pre-paging Unices in particular had
comparatively high I/O load on swap since the entire process space
needed to be read/written.  (Hence the use of drums in better-equipped
sites).

For FreeBSD (and other modern Unices), processes are initially paged
in from the filesystem.  Under high memory load, pages will be paged
to/from swap and from the filesystem.  The removal of the need to
swap entire processes and the removal of text (and other read-only
data) from swap both reduce the I/O load of the swap device.

It's no longer clear to me that dedicating the fastest piece of disk
to swap is the best solution.

The above is somewhat simplified - it ignores sticky executables
(which transform filesystem I/O into swap I/O) and mmap(2) (which can
result in paging to, as well as from, the filesystem) - but I believe
it is generally representative.

Peter

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?20011220073554.Q73243>