Post on 31-Dec-2015
description
Assignment 11
Q2) A memory system has a memory access time of 250 nanoseconds and a page fault service time of 50 milliseconds.
b) If there are no page faults, the effective access time is equal to the memory access time. Suppose that even with page faults, we do not want the effective access time to degrade by more than 10 %. What should the page fault rate be to achieve this?
p < 25 / 49999750 p < 5 * 10-7
p * 49999750 < 25p * 49999750 < 275 – 250250+p * 49999750 < 275250 +p(– 250 + 50000000) < 275250 – 250 p + 50000000 p < 275
(1-p)*250+p*50000000 < 275(1-p) * memory access time + p*page fault service time < ( 250 ns + 25 ns )
We wantEAT < (memory access time + 10% of memory access time)
A page has 3 cases
Page in TLB
Page in PT&
v=1 (in Memory)
Page in PT&
v=0 (not in Memory)(page fault)
TLB hit ratio * (TLB lookup time + memory access time)
(1- TLB hit ratio – page fault rate) * (TLB lookup time + PT lookup time + memory access time)
page fault rate *(TLB lookup time + PT lookup time + swap page out time + swap page in time + memory access time)
+
+
EAT = Q3
Assignment 12
Block number = address/block size
Byte offset = address – address at the beginning of the block = address – (block number*block size)
Q2
Maximum number of bytes addressed by n direct pointers is= Number of direct pointers * BlockSize
Maximum number of bytes addressed by a single indirect pointer is= NumberOfEntriesInOneBlock * BlockSize= (BlockSize / PointerSize) * BlockSize
Maximum number of bytes addressed by a double indirect pointer is= NumberOfEntriesInOneBlock 2 * BlockSize= (BlockSize / PointerSize)2 * BlockSize
Maximum number of bytes addressed by a triple indirect pointer is= NumberOfEntriesInOneBlock 3 * BlockSize = (BlockSize / PointerSize)3 * BlockSize
K M G T 210 B = KB220 B = MB230 B = GB240 B = TB
Q3
1
2
.
.
.
.
.13
14
15
16
direct
indirect
double
triple
i-node
Block = 8K
4 bytes
8KB/4B= 2K entry(pointer) = 2000 entry
8KB/4B= 2K entry(pointer)=2000 entry
8KB/4B= 2K entry(pointer)= 2000 entry
104KB
16MB
32 GB
64 TB
1
2
.
.
.
.
.13
14
15
16
direct
indirect
double
triple
i-node
Block = 8K
4 bytes
104KB 13 * 8KB = 104 KB
1
2
.
.
.
.
.13
14
15
16
direct
indirect
double
triple
i-node
Block = 8K
4 bytes
8KB/4B= 2K entry(pointer) = 2000 entry
16MB
2000 * 8 KB = 16000 KB covert to MB= 16 MB
1
2
.
.
.
.
.13
14
15
16
direct
indirect
double
triple
i-node
Block = 8K
4 bytes 8KB/4B= 2K entry(pointer)=2000 entry
32 GB
2000 2000*2000 * 8Kentry entry 4,000,000 * 8K 32,000,000 KB convert to GB by /1,000,000 32 GB
1
2
.
.
.
.
.13
14
15
16
direct
indirect
double
triple
i-node
Block = 8K
4 bytes
8KB/4B= 2K entry(pointer)= 2000 entry
64 TB
2000 2000*2000entry entry = 4,000,0000 4,000,000*2000 * 8K entry entry 8,000,000,000 * 8K = 64,000,000,000 KB convert to TB by /1000,000,000 = 64 TB
Maximum number of bytes addressed by n direct pointers is= Number of direct pointers * BlockSize
Maximum number of bytes addressed by a single indirect pointer is= NumberOfEntriesInOneBlock * BlockSize= (BlockSize / PointerSize) * BlockSize
K M G T 210 B = KB220 B = MB230 B = GB240 B = TB
= 13* 8 KB
= 104 KB
= (8 KB / 4 B )* 8 KB= 2 K * 8 KB
= 2000 * 8 KB= 16000 KB= 16 MB
Maximum number of bytes addressed by a double indirect pointer is= NumberOfEntriesInOneBlock 2 * BlockSize= (BlockSize / PointerSize)2 * BlockSize
Maximum number of bytes addressed by a triple indirect pointer is= NumberOfEntriesInOneBlock 3 * BlockSize = (BlockSize / PointerSize)3 * BlockSize
K M G T 210 B = KB220 B = MB230 B = GB240 B = TB= ( 8 KB / 4 B)2 * 8 KB
= ( 23 . 210 / 22)2 * (23 . 210 B) = ( 211 )2 * 213 B = 222 * 213 B= 22 * 220 * 23*210 B= 25 * 230 B= 32 GB
= ( 8 KB / 4 B)3 * 8 KB
= ( 23 . 210 / 22)3 * (23 . 210 B) = ( 211 )3 * 213 B = 233 * 213 B= 23 * 230 * 23*210 B= 26 * 240 B= 64 TB
Maximum file size is 64 TB + 32 GB + 16 MB + 104 KB