Hierarchical_Paging
Hierarchical_Paging
Hierarchical_Paging
(Multi-levels paging)
(forward paging)
(paging the page table)
Hierarchical Paging
F 4MB
#1RREXtwo level paging, ainoretet.weonyliliecd.eoomypmeano.ns.o.t.h.e
is an index into the outer page table and
Level-2 paging
inner page table. Level-1 paging
Alilentry #$Atg.E offset
> Level-1 page table pl
p2
no.
Table #lentry #*40 Eframe
10 bits
N-1enel
A two-level page-table scheme
Logical address
Level-2 offset
Level-1
Physical
memory
Physical address
Outer-page
table 2 inner-page
table
in mem.
#Bl : if we use the M levels paging scheme, and assume the TLB hit ratio is P, the EMAT will be
Node structure in a link list @L&EEd: (1) the virtual page number, (2) the value
of the mapped page frame, and (3) a pointer to the next element in the linked list.
18
Hashing page table Em
physical
Logical address
address
Physical
memory
Hash
15 Nil
function
e.g.
Page
Table
Cont.
TA Poye 22 Physical
search
R Peoe 2
PA PMt2
pid
⼲含 memory
H Physical address
0Vaihble
Cont
队A
1 反躬分五表
IA Plep L ⼀2
KEe PAeL
PIP 就同阿可能夫⼦
V r 以
Gppmenndoeaahnme mEa Rm
fin a
mdt t aces mem, Wirite tficte mey-atos ine ( Ehn Na
08s ld)24hs ( )
o ( + ) + b (o 4x 2) * 2 )
7
mAaremati
cntries me forbas the6Mpagewital
needed abieses
table? a s a damwg Aps a2X Ho mmyz 5
po 1
V"N R PUe LTwand: ▇ rty ▇ b 1 ttul
49 5 4
o pa) Given a compuiler syatem with a vintaAsddress, let the system be only
byte-addressable. Assume that every page is of 32KB with 4 bytes per page entry in the page
table. Suppose that the frame nu needs byes to stor
ore. Please answer the following
ese ) t Jes
eel pa PT . - oefin
(4 konel )
a. (S pts) Suppose that we have multi-level paging, How many leyeks do we have in muli-level
paging?
4 bytes
page Table entrim
20 - 2" Tentry
½. 4- Level payry
b,
&kB
Assume a
program
scenario how each has just referenced an
ofthe address in virtual
why.)
/. ILB
following canoccur: memory.
(If a Describe a
miss withno scenario cannot
TLBhitandno page fault(3%) occur, explain
pagefoult b.MLB
(290) missand
pagefault
dTLBhitandpage (3%)
fault(2%)
wa aetlnineeeceeabrncvtermd e the) ate comen
arr
o adines mure wih TK per pae mnd * hyesper pege titble anitey the ta
)
0) I
t B,bui ha in cache and puge GaAeslnbr mn
s possible to mis in o * 2 4Ba
p106
Ab
Wa:
aeede ecteeinghat bheck a umcae was mAe E
( Ya multilevelmins nt na 2ws tsniusoa msa
page number.page tables, ▇bie eentry contains a frame umber.
aiah penalty
miss will be. tabies, the ore vels a pNge table has, the nighenthe T ▇
aaitileve
08 a
AC
6b
1PT 4 b
- Y1▇ t- 2
F n
23
Process logical memory).=-fEsegment Bo4t.•asAlithi.BFlogical
viewpoint.
> PIEd : code segment, data segment, stack segment, etc.
g> Check d<limit? Ifing, this will cause the trap of illegal memory address
(> Otherwise, it is legal. MMU adds the base and d to form the physical address
scheme
Logical address
CPU
Physical • 5vo
Trap
No limt YES address
Physical
memory
Process limit base
D
3300
7500
730 k 75uo
3300
Segment table
pactice (度の 計#)
Segment No, Length
Given the following logical address くs, d,
6ー
1219
2300
700
14
Calculate the physical address based on the left-side segment table?
(1)<0,600>
(2)<1,33>
90 100 (3) く 2,80>
(4) く 3,580s
1327 580
0 邦メ 5 み合志
Z5UU Jh
M01UU
1327 580
4 1952 96
Mat are the physical addresses reference in the following item wil cause an illegal)
eddress trap toOs for the following logical addresses?
M 0,830
( -,JU
の 3,350
旭 4,112
(105中央⼯作業系研興計算機組釧
AcE
比較表 中論 segment
各段⼤⼩不⼀定相同
page
各 size ⼤⼩相同 採⽤ viewpoint
⼤⼩
觀點
採⽤ viewpoint 有 Y99 ⾞强
沒有
沒有
外部碎裂
YES 容易實施
以双装员 以er 看法⼀彩
有
内部碎裂
Support
YES 但是比較困難實施
memory
sharing and
protection
比較 d limit
EMAT 比較短
YES
Need YES
hardware
support
Physical
好處 memory 是由⼀組frames 所組成
1沒有外部碎裂
缺點
1 Table 數⽬太多
sharing and protection 的好處
2 EMAT更長
③4 會有內部碎裂
也是需要額外硬體⽀援
Paged segment memory management
Logical address
It page size Frune
d
CPU
Physical
No YES
Trap address
Physical
memory
Page no Frame
limit Page no
table frtt
Segment table