Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2013 16:13:39 -0400
From:      Paul Kraus <paul@kraus-haus.org>
To:        jb <jb.1234abcd@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: "swap" partition leads to instability?
Message-ID:  <7695CBFB-60A6-4E64-BB8B-FD0413271A9D@kraus-haus.org>
In-Reply-To: <loom.20130529T213928-77@post.gmane.org>
References:  <1369558712.96152.YahooMailNeo@web165006.mail.bf1.yahoo.com> <loom.20130526T143506-872@post.gmane.org> <20130529133516.295084a6@gumby.homeunix.com> <loom.20130529T213928-77@post.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 29, 2013, at 3:52 PM, jb <jb.1234abcd@gmail.com> wrote:

> Yes, there is some confusion about the diff, if any, between paging =
and=20
> swapping.
>=20
> Paging - copying or moving pages between physical memory (RAM) and =
secondary
>  storage (e.g. hard disk), in both directions.
> Swapping - nowdays is synonymous with "paging".

> You say that FB supports both, Linux supports paging only.
> Well, Linux utilizes swap space as part of virtual memory.
> So, can you elaborate more on that - what is the essence of the diff, =
why
> should I avoid the term "swapping" when referring to Linux, assuming =
VMM
> systems on both ?

	When I started working professionally with Unix systems in 1995, =
I was taught that paging was the process of copying least used "pages" =
of RAM onto disk so that the RAM could be freed if the system needed =
more RAM. Swapping was the process of moving an entire program from RAM =
to disk in order to free up RAM.

	In other words, a process can be "swapped out" and placed on =
disk until it comes up to run again, at which point it can be "swapped =
in" and executed.

	I think that much of the confusion comes from the use of the =
SWAP device by the PAGING system. When the concept of paging came about, =
it just used the already existing SWAP space to store it's "paged out" =
pages of memory.

	On the systems I worked on at the time (SunOS / Solaris), paging =
was a sign of pressure on the physical memory (RAM) of a system, =
swapping was a sign of _severe_ physical memory pressure. This was a =
time when we configured 2 to 4 times the amount of physical RAM as SWAP =
space. RAM was very expensive and hard drives just expensive :-) It was =
common on a "normally" operating system to see the page scanner* running =
up to 100 times per second. A scan rate of over 100 was considered a =
sign of pressure on RAM that needed to be addressed, any SWAPing was =
considered a sign that the system needed more physical RAM.

	Today RAM is so cheap that _any_ paging is often considered bad =
and an indication that more Ram should be added.

*Solaris Page Scanner: This is a kernel level process that wakes up, =
examines the amount of free RAM, and takes action based on that value. =
The thresholds are all dynamic and based on the amount of RAM in the =
system. Above a high water mark the scanner does nothing. As the amount =
of free RAM drops, various pages of RAM are copied to SWAP space and the =
RAM freed. Eventually, if the amount of free Ram falls low enough, even =
parts of the kernel will be paged out. This is very bad and can lead to =
a system "thrashing" where it spends the vast majority of it's time just =
paging in and out and not actually getting anything done.

--
Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7695CBFB-60A6-4E64-BB8B-FD0413271A9D>