13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

116 Space Management Chapter 3<strong>An</strong>other tunable parameter, ‘‘startup-phase process limit,’’ determines how manyprocesses are allowed to be in startup phase simultaneously.It makes sense, by the way, to allow more than one process to be starting up at thesame time. We will see in Chapter 5 that the average time spent by the backing store inretrieving a page can be reduced by increasing the number of outstanding requests to thebacking store. The time required to start two processes simultaneously can be less thanthe time required to start them one after the other. The purpose of controlling startupphaseconflict is to balance processor and backing store utilization.8 PERSPECTIVEMost modern operating systems use some form of space management, even operatingsystems for personal computers and workstations. We have devoted quite a lot of effortto paging because it is both complicated and very widely used. Paging works fairly well.In a well-tuned operating system, a process will access about 50 percent of the pages inits working set during any quantum. As long as main store is large enough to hold theworking sets of all the ready processes, very little time is wasted by swapping. Reducingthe level of multiprogramming cures thrashing when it occurs.Unfortunately, many smaller computers, including the DEC PDP-11 and theMotorola MC68000, do not store enough information when page faults occur to allow thefaulting instruction to be restarted. Segmentation is the primary facility implemented onthese machines.More often, the operating system designer is constrained by the hardware of themachine. The absence of a Used field has a major impact on the methods that are used.Whether the hardware saves the Used and Dirty fields in the page table or in the pageframetable also makes a difference. Newer machines have increasingly complex translationhardware. Two-layer page tables are not uncommon because processes that needvery large virtual stores need very long page tables. Only the active part of the pagetables needs to reside in main store.We have seen that the storage manager has scheduling responsibilities as well asstorage responsibilities. This blurring of function is unfortunately common withinoperating systems. In addition, the storage manager must deal with device drivers (discussedin Chapter 5) to swap pages in and out. Organizing the kernel to keep functionsseparate and modular is not always easy. Figure 3.23 shows one way to structure the kernelto contain the parts we have discussed so far. The kernel is not a monolithic programbut is composed of individual managers for different resources. The managers may communicatein a variety of ways, some of which we will see in Chapters 8 and 9. For nowwe can assume that they share certain data structures such as process lists. The situationsthat can arise are represented by interrupts from devices and by service calls and trapsfrom running processes. These interrupts, service calls, and traps switch context to thekernel, which then executes the appropriate manager.A clock interrupt causes the scheduler to be called. The scheduler might take thisopportunity to switch to a different process. A page (or segment) fault causes the storagemanager to be called. The storage manager might decide that a particular page frame

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!