Design Issues for Paging Systems
Load Control
Consider the case where all processes want more memory.
In such a case the processor would need to remove one or more processes from
memory.
Load Control is deployed to achieve the target,
i.e to remove one or more processes from memory in order
to fulfill the memory requirement
of another process.
Load Control using Working Set and Page Fault Frequency Algorithm
-
Approach involves determining number of processes that
are resident in main memory i.e multiprogramming level.
-
Working Set and Page Fault Frequency algorithm implicitly
perform load control as they change the resident set after
every clock cycle.
-
Adjust page fault such that time between page fault is equal
to time required to process page fault.
Load Control using Clock Page Replacement Algorithm
-
Monitor the rate at which the pointer scans the buffer
of frames.
-
If number of page faults is below a certain level,
which results in fewer requests to advance the pointer OR
-
Average number of frames scanned by pointer per request
is small, THEN
-
Number of processes on memory cn be increased.
Reducing number of process in main memory
-
Remove process with lowest priority
-
Remove process with lowest probability of having
a working set in main memory i.e highest probability
of page fault.
-
Remove last activated process
-
Remove process with smallest working resident set.
-
Remove largest process
-
Remove process with largest remaining execution window.
Page Size
Page Size affects implementation in a variety of ways and choosing
an optimal page size is very important.
General considerations
-
Internal Fragmentation
Smaller page size means lower
internal fragmentation. Larger page size means more
internal fragmentation.
-
Smaller page size means more number of processes per
process and larger page tables.
Co-relation between page size and page fault rate
-
Small page size -> more number of pages in memory ->
lesser page faults AND larger page table
-
Large page size -> less pages in memory ->
smaller page table AND larger page size
Object Oriented Techniques to reduce multiprogramming
-
More number of modules with small sized code.
-
Deploy multithreaded applications
Global vs. Local Allocation of pages
Local Replacement Policy:
choose among resident set of process that generated page fault
Global replacement policy:
choose among all pages eligible for replacement in main memory
Types of allocations
-
Fixed Allocation, Local scope. Allocations cannot
be too large or too small as it would be irreparable.
-
Variable allocation, Global Scope
Processes that fault a lot need more replacement.
difficult to obtain a good replacement policy.
-
Variable Allocation, Local Scope
-
Re-evaluate allocation from time to time.
Credits
- Referred to Notes by Professor Daniel Katz.
(previously professor of Operating Systems at
NYU Tandon School of Engineering)