16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

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.

Process Scheduling<br />

Figure 57. Mapping Process Space<br />

onto <strong>the</strong> Swap Device<br />

Figure 58. Swapping a Process into Memory<br />

Theoretically, all memory space occupied by a<br />

process, including its u area and kernel stack, is<br />

eligible to be swapped out, although <strong>the</strong> kernel may<br />

temporarily lock a region into memory while a<br />

sensitive operation is underway.<br />

! Fork Swap<br />

The fork systems call assumes that parent process<br />

found enough memory to create <strong>the</strong> child context.<br />

The parent places <strong>the</strong> child in <strong>the</strong> "ready-to-run"<br />

state and returns to user mode.<br />

! Expansion Swap<br />

Process requires more physical memory than is allocated (user stack growth or brk system call).<br />

Figure 59. Adjusting Memory Map for<br />

Expansion Swap<br />

177<br />

! Swapping Processes In<br />

When <strong>the</strong> swapper wakes up to swap<br />

processes in, it examines all processes<br />

that are in <strong>the</strong> state "ready to run but<br />

swapped out" and selects one that has<br />

been swapped out. <strong>the</strong> longest.

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

Saved successfully!

Ooh no, something went wrong!