| previous | contents | up | next |
The Unix SVR4 daemon which performs the paging out operation is called pageout. It is a long running daemon and is created at boot time. The pageout process cannot be killed. There are three kernel variables which control the paging operation (Unix SVR4):
Swapping: Let's say you start ten heavyweight processes (for example, five xterms, a couple netscapes, a sendmail, and a couple pines) on an old 486 box running Linux with 16MB of RAM. Basically, you *do not have* enough physical RAM to accomodate the text, data, and stack segments of all these processes at once. Since the kernel cannot find enough RAM to fit things in, it makes use of the available virtual memory by a process known as swapping. It selects the least busy process and moves it in its entirety (meaning the program's in-RAM text, stack, and data segments) to disk. As more RAM becomes available, it swaps the process back in from disk into RAM. While this use of the virtual memory system makes it possible for you to continue to use the machine, it comes at a very heavy price. Remember, disks are relatively slower (by the factor of a million) than CPUs and you can feel this disparity rather severely when the machine is swapping. Swapping is not considered a normal system activity. It is basically a sign that you need to buy more RAM.
In Unix SVR4, the process handling swapping is called sched (in other Unix variants, it is sometimes called swapper). It always runs as process 0. When the free memory falls so far below minfree that pageout is not able to recover memory by page stealing, sched invokes the syscall sched(). Syscall swapout is then called to free all the memory pages associated with the process chosen for being swapping out. On a later invocation of sched(), the process may be swapped back in from disk if there is enough memory.
| previous | contents | up | next |