Chapter3_Memory

Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

Operating Systems

Chapter 3 Memory Management

Tien Pham Van, Dr. rer. nat.

(Lecture compiled with reference to other presentations)

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 1
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Concept

• Memory management is the act of


managing computer memory.
• It involves providing ways to allocate
portions of memory to programs at
their request, and freeing it for reuse
when no longer needed.
• The management of main memory is
critical to the computer system,
particular embedded systems

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 2
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management Requirements
• Relocation
– Programmer does not know where the
program will be placed in memory
when it is executed
– While the program is executing, it may
be swapped to disk and returned to
main memory at a different location
(relocated)
– Memory references must be translated
in the code to actual physical memory
address

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 3
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 4
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management Requirements
• Protection
– Processes should not be able to reference memory
locations in another process without permission
– Impossible to check absolute addresses at compile time
– Must be checked at run time
– Memory protection requirement must be satisfied by
the processor (hardware) rather than the operating
system (software)
• Operating system cannot anticipate all of the memory
references a program will make

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 5
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management Requirements

• Sharing
– Allow several processes to access the same portion of
memory
– Better to allow each process access to the same copy of
the program rather than have their own separate copy

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 6
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management Requirements

• Logical Organization
– Programs are written in modules
– Modules can be written and compiled independently
– Different degrees of protection given to modules (read-
only, execute-only)
– Share modules among processes

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 7
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
• Operating Systems 2 - Memory Manager -
YouTube
https://www.youtube.com/watch?v=qdkxXygc3rE&t=
195s

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 8
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management Requirements

• Physical Organization
– Memory available for a program plus its data may
be insufficient
• Overlaying allows various modules to be assigned the
same region of memory
– Programmer does not know how much space will
be available

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 9
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Overview clip

• Address Binding,Address Translation and


Memory Management Unit Tutorial-2 -
YouTube
https://www.youtube.com/watch?v=_kPCbBGRl1o&lis
t=PLskQvPDUk0sJnmLgi4qBRyshlmHydbsAJ&index=3

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 10
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
MMU

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 11
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Fixed Partitioning
• Equal-size partitions
– Because all partitions are of equal size, it does not matter
which partition is used
– Main memory use is inefficient. Any program, no matter
how small, occupies an entire partition. This is called
internal fragmentation.
• Unequal-size partitions
– Can assign each process to the smallest partition within
which it will fit
– Queue for each partition
– Processes are assigned in such a way as to minimize
wasted memory within a partition

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 12
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 13
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Dynamic Partitioning

• Partitions are of variable length and number


• Process is allocated exactly as much memory as
required
• Eventually get holes in the memory. This is called
external fragmentation
• Must use compaction to shift processes so they are
contiguous and all free memory is in one block

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 14
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 15
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Dynamic Partitioning Placement Algorithm

• Operating system must decide which free block to


allocate to a process
• Best-fit algorithm
– Chooses the block that is closest in size to the request
– Worst performer overall
– Since smallest block is found for process, the smallest
amount of fragmentation is left
– Memory compaction must be done more often

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 16
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Dynamic Partitioning Placement Algorithm
• First-fit algorithm
– Scans memory form the beginning and chooses the first
available block that is large enough
– Fastest
– May have many process loaded in the front end of
memory that must be searched over when trying to find a
free block

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 17
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Dynamic Partitioning Placement Algorithm

• Next-fit
– Scans memory from the location of the last placement
– More often allocate a block of memory at the end of
memory where the largest block is found
– The largest block of memory is broken up into smaller
blocks
– Compaction is required to obtain a large block at the end
of memory

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 18
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 19
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
• https://www.youtube.com/watch?v=ue
V1gcYJSZg

20
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Buddy System
• Entire space available is treated as a single block of
2U
• If a request of size s such that 2U-1 < s <= 2U, entire
block is allocated
– Otherwise block is split into two equal buddies
– Process continues until smallest block greater than or
equal to s is generated

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 21
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 22
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 23
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Addresses
• Logical
– Reference to a memory location independent of the
current assignment of data to memory
– Translation must be made to the physical address
• Relative
– Address expressed as a location relative to some known
point
• Physical
– The absolute address or actual location in main memory

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 24
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 25
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Paging

• Partition memory into small equal fixed-size chunks


and divide each process into the same size chunks
• The chunks of a process are called pages and chunks
of memory are called frames
• Operating system maintains a page table for each
process
– Contains the frame location for each page in the process
– Memory address consist of a page number and offset
within the page

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 26
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Page Size (1)

Small page size


• Advantages
– less internal fragmentation
– better fit for various data structures, code sections
– less unused program in memory
• Disadvantages
– programs need many pages, larger page tables

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 27
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Page Size (2)
• Overhead due to page table and internal
fragmentation

page table space

se p
overhead = + internal
p 2 fragmentation

• Where
– s = average process size in bytes
Optimized when
– p = page size in bytes
p = 2se
– e = page entry
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 28
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Page size (3)
Smallest
Architecture page Larger page sizes
size
2 MiB, 1 GiB (only when the CPU
x86-64[18] 4 KiB
has PDPE1GB flag)
Power ISA[21] 4 KiB 64 KiB, 16 MiB, 16 GiB
SPARC v8 with SPARC
4 KiB 256 KiB, 16 MiB
Reference MMU[22]

64 KiB, 512 KiB (optional), 4 MiB, 32 MiB


UltraSPARC
8 KiB (optional), 256 MiB (optional), 2 GiB (optional),
Architecture 2007[23]
16 GiB (optional)

64 KiB, 1 MiB ("section"), 16 MiB


ARMv7[24] 4 KiB ("supersection") (defined by a particular
implementation)

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 29
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Page size (4)
#include <stdio.h>
#include <unistd.h> /* sysconf(3) */

int main(void)
{
printf("The page size for this system is %ld bytes.\n",
sysconf(_SC_PAGESIZE)); /* _SC_PAGE_SIZE is OK too. */

return 0;
}

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 30
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 31
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Virtual Memory

• https://www.youtube.com/watch?v=AKGtJAi
4wGo&ab_channel=Xoviabcs
https://www.youtube.com/watch?v=AKGtJAi4wGo

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 32
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 33
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Virtual Memory Paging

The position and function of the MMU

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 34
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Paging and translation

The relation between


virtual addresses
and physical
memory addres-
ses given by
page table

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 35
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Internal Operation of MMU with 16 4 KB Pages*

16 bit addresses => address space size: 216


Page size ~4K ~ 212 => 216 / 212 = 24 = 16 pages.
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 36
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Segmentation

• All segments of all programs do not have to be of


the same length
• There is a maximum segment length
• Addressing consist of two parts - a segment number
and an offset
• Since segments are not equal, segmentation is
similar to dynamic partitioning

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 37
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 38
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 39
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 40
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Hardware Support

• For each process, a pointer to the page


table is stored with the other register values
(like the instruction counter) in the PCB
• When the dispatcher starts a process, it
must reload all registers and copy the
stored page table values into the hardware
page table in the MMU.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 41
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 42
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Solutions to Large Page Table Problems

The MMU contains only a Page-Table Base Register


which points to the page table. Changing page tables
requires changing only this one register, substantially
reducing context switch time. However this is very
slow! The problem with the PTBR approach, where the
page table is kept in memory, is that TWO memory
accesses are needed to access one user memory
location: one for the page-table entry and one for the
byte. This is intolerably slow in most circumstances.
Practically no better than swapping!

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 43
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Solutions to Large Page Table Problems (cont.)

Multilevel page tables avoid keeping one huge page table in memory
all the time: this works because most processes use only a few of its
pages frequently and the rest, seldom if at all. Scheme: the page
table itself is paged.
Example: Using 32 bit addressing:
The top-level table contains 1,024 pages (indices). The entry at each
index contains the page frame number of a 2nd-level page table. This
index (or page number) is found in the 10 highest (leftmost) bits in the
virtual address generated by the CPU.
The next 10 bits in the address hold the index into the 2nd-level page
table. This location holds the page frame number of the page itself.
The lowest 12 bits of the address is the offset, as usual.
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 44
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Two-level Page Tables

32 bit address with 2 page table fields


Revisit to clip: https://www.youtube.com/watch?v=AKGtJAi4wGo
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 45
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Solutions to Large Page Table Problems (cont.)
A small, fast lookup cache called the TRANSLATION LOOK-
ASIDE BUFFER (TLB) or ASSOCIATIVE MEMORY.
The TLB is used along with page tables kept in memory.
When a virtual address is generated by the CPU, its page
number is presented to the TLB. If the page number is
found, its frame is immediately available and used to access
memory. If the page number is not in the TLB ( a miss) a
memory reference to the page table must be made. This
requires a trap to the operating system. When the frame
number is obtained, it is used to access memory AND the
page number and frame number are added to the TLB for
quick access on the next reference. This procedure may be
handled by the MMU, but today it is often handled by
software; i.e. the operating system.
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 46
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 47
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Solutions to Large Page Table Problems (cont.)
•For larger addressing, such as 64 bits, even multi-level page tables
are not satisfactory: just too much memory would be taken up by
page tables and references would be too slow.
•One solution is the Inverted Page Table. In this scheme there is not
one page table for each process in the system, but only one page
table for all processes in the system. This scheme would be very
slow alone, but is workable along with a TLB and sometimes a hash
table.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 48
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management with Bit Maps

• Part of memory with 5 processes, 3 holes


– tick marks show allocation units
– shaded regions are free
• Corresponding bit map
• Same information as a list

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 49
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Memory Management with Linked Lists

Four neighbor combinations for the terminating process X

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 50
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Page Replacement Algorithms

When a page fault occurs, the operating system must


choose a page to remove from memory to make room
for the page that has to be brought in.
•On the second run of a program, if the operating
system kept track of all page references, the “Optimal
Page Replacement Algorithm” could be used:
replace the page that will not be used for the longest
amount of time. This method is impossible on the
first run and not used in practice. It is used in theory
to evaluate other algorithms.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 51
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Page Replacement Algorithms

• Page fault forces choice


– which page must be removed
– make room for incoming page
• Modified page must first be saved
– unmodified just overwritten
• Better not to choose an often used page
– will probably need to be brought back in soon

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 52
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Optimal Page Replacement Algorithm

• Replace page needed at the farthest point in future


– Optimal but unrealizable
• Estimate by …
– logging page use on previous runs of process
– although this is impractical

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 53
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Not Recently Used Page Replacement Algorithm

• Each page has Reference bit, Modified bit


– bits are set when page is referenced, modified
• Pages are classified
– not referenced, not modified
– not referenced, modified
– referenced, not modified
– referenced, modified
• NRU removes page at random
– from lowest numbered non empty class

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 54
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
FIFO Page Replacement Algorithm

• Maintain a linked list of all pages


– in order they came into memory
• Page at beginning of list replaced
• Disadvantage
– page in memory the longest may be often used

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 55
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Second Chance Page Replacement Algorithm

• Operation of a second chance


– pages sorted in FIFO order
– Page list if fault occurs at time 20, A has R bit set
(numbers above pages are loading times)

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 56
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
The Clock Page Replacement Algorithm

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 57
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Least Recently Used (LRU)

• Assume pages used recently will used again soon


– throw out page that has been unused for longest time
• Must keep a linked list of pages
– most recently used at front, least at rear
– update this list every memory reference !!
• Alternatively keep counter in each page table entry
– choose page with lowest value counter
– periodically zero the counter

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 58
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
LRU example

•Add a register to every


page frame - contain the
last time that the page in
that frame was accessed
•Use a "logical clock"
that advance by 1 tick
each time a memory
reference is made.
•Each time a page is
referenced, update its
register

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 59
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Least-Frequently-Used (LFU) Page Replacement

• LFU page replacement


– Replaces page that is least intensively referenced
– Based on the heuristic that a page not referenced often is
not likely to be referenced in the future
– Could easily select wrong page for replacement
• A page that was referenced heavily in the past may never be
referenced again, but will stay in memory while newer, active
pages are replaced

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 60
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
The Working Set Page Replacement Algorithm(1)

The ‘working set’ is represented by w(k,t). This is the set of


pages, where ‘t’ is any instant in time and ‘k’ is a number of recent
memory references. The ‘working set’ set changes over time but
slowly. When a process must be suspended ( due to an I/O wait
or lack of free frames), the w(k, t) can be saved with the process.
In this way, when the process is reloaded, its entire w(k,t) is
reloaded, avoiding the initial large number of page faults. This is
called ‘PrePaging’.
The operating system keeps track of the working set, and when a
page fault occurs, chooses a page not in the working set for
replacement. This requires a lot of work on the part of the
operating system. A variation, called the ‘WSClock Algorithm’,
similar to the ‘Clock Algorithm’, makes it more efficient.

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 61
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Algorithm review

• Clock Page Replacement - YouTube


https://www.youtube.com/watch?v=b-dRK8B8dQk

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 62
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
The Working Set Page Replacement Algorithm(2)

The working set algorithm


Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 63
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
The WSClock Page Replacement Algorithm

Operation of the WSClock algorithm


Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 64
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
• CSE 312 Spring 2021 May 03 WSClock algo,
Design issues with memory management -
YouTube
https://www.youtube.com/watch?v=DAyoL-tNnwo

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 65
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
Review of Page Replacement Algorithms

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 66
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596
References

• Ebook: “Linux Kernel Source Code – Heavily


commented”
– Chapter 4. Protection mode and its
programming
– Chapter 5. Linux kernel architecture
– Chapter 13. Memory management

Embedded Networking Research Group School of Elec. and Telecom - Hanoi University of Science and Technology 67
Email: [email protected] C9-411, Dai Co Viet str. 1, HBT, Hanoi Tel: +84-243-8693596

You might also like