Professional Documents
Culture Documents
Some allocate a page table for each process. A pointer to the page
table is stored with the other register values (like the instruction
counter) in the process control block.
Effective access time = hit ratio x time taken for TLB hit +
miss ratio x time taken for TLB miss
Example
Explanation:
- TLB hit takes 120 nanoseconds total ( 20 to find the
frame number and then another 100 to go get the data )
- TLB miss takes 220 ( 20 to search the TLB, 100 to go
get the frame number, and then another 100 to go get
the data.
Because we page the page table, the page number is further divided into a
10-bit page number and a 10-bit page offset. Thus, a logical address is as
follows:
where p1 is an index into the outer page table and p2 is the displacement
within the page of the inner page table.
Because address translation works from the outer page table inward, this
scheme is also known as a forward-mapped page table.
Address translation
Structure of the Page Table
Structure of the Page Table
2. Hashed Page tables
Each element consists of three fields: (1) the virtual page number, (2)
the value of the mapped page frame (3) a pointer to the next element
in the linked list.
Structure of the Page Table
2. Hashed Page tables
How it works:
It stores one entry per physical frame, and is a linear array where the
contents at each location is <pid (process id), virtual page number>
and the index of each location is the physical frame address.
The formula will change now:
Each page table may consist of millions of entries. These tables may
consume large amounts of physical memory just to keep track of how
other physical memory is being used.
Structure of the Page Table
3. Inverted Page Table
The idea behind inverted page tables is to have a single page table on
the operating system level that is not tied to any specific process. It is
based on the observation that the CPU only references entries in those
pages that are already present in memory. The number of pages that
are present in physical memory frames are far less than the total
number of virtual pages that are on disk. Having a single table that
maps occupied memory frames to virtual pages consumes far less
space than having a page table for each process that is big enough to
fit all virtual pages.
Segmentation
• It is a memory management scheme in which the memory
allocated to the process is non contiguous
• Logical address space is divided into number of small blocks
called segments
• Segments are of variable sized.
1. The code
2. Global variables
3. The heap, from which memory is allocated
4. The stacks used by each thread
5. The standard C library
Segmentation
• Users view memory as a collection of variable size segments.
With no necessary ordering of these segments
1
4
1
2
3 2
4
3
c) logical address
MCQ
2. Memory management technique in which system stores and
retrieves data from secondary storage for use in main
memory is called
a) fragmentation
b) paging
c) mapping
d) none of the mentioned
MCQ
2.
b) paging
MCQ
3. The address of a page table in memory is pointed by
a) stack pointer
b) page table base register
c) page register
d) program counter
MCQ
3.
b) page table base register
MCQ
4. Program always deals with
a) logical address
b) absolute address
c) physical address
d) relative address
MCQ
4.
a) logical address
MCQ
5.
The page table contains
a) base address of each page in physical memory
b) page offset
c) page size
d) none of the mentioned
MCQ
5.
a) each process
MCQ
7. Locality of reference implies that the page reference being made
by a process
a. will always be to the page used in the previous page reference.
b. will always be to the page used in the previous page reference.
c. will always be to one of the pages existing in memory.
d. will always lead to a page fault.
MCQ
Ans 7: b