The Scheduler

Team-Fly    

Solaris™ Operating Environment Boot Camp
By David Rhodes, Dominic Butler
Table of Contents
Chapter 7.  Swap Space


The task of choosing which process gets swapped out is undertaken by process 0 (the sched process, which is part of the Solaris kernel). If possible, the process swapped out will be in a sleeping state so as not to interrupt one that is actually running on a CPU at the time. Once the new process is running in memory, it too could be swapped out to the swap partition to make room for another new process.

Of course, when a process has been swapped out, it is not simply left there, as it would never get a chance to run again. So the sched process also manages the swapping back in of swapped-out processes. If there is not enough room in memory to swap a process back in, then another will have to be swapped out first. This juggling of processes between memory and disk uses up system resources and can have quite an impact on the overall performance of the system. In general, the more memory you have installed, the less often a process will need to be swapped out. Of course, this is heavily dependent on what the system is actually used for.

The amount of memory is important to the performance of the system, but the size of swap space is also important. If the swap space is not big enough, you could get a situation where sched needs to swap a process out of memory, but the swap space is already full so there is no room for it. A situation like this would cause the failure of many running processes and could lead to a system crash.

In times of yore when memory was expensive and disks were not that big, the sizing of the swap space could be a rather delicate balancing act. Thankfully, nowadays systems can support larger amounts of cheap memory, and available disk sizes still seem to be growing exponentially. This makes the planning of swap space less of an issue, though it is still important and something you need to be aware of.


    Team-Fly    
    Top
     



    Solaris Operating Environment Boot Camp
    Solaris Operating Environment Boot Camp
    ISBN: 0130342874
    EAN: 2147483647
    Year: 2002
    Pages: 301

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net