Exercise

spcl.inf.ethz.ch
@spcl_eth
SALVATORE DI GIROLAMO (TA)
Networks and Operating Systems:
Exercise Session 3
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
2
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
3
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
1
Memory
4
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
1
Memory
5
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
1
6
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
1
7
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
1
2
3
1
2
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
1
8
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
1
2
3
1
2
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
1
9
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
1
2
3
4
1
2
3
1
2
5
6
1
2
1
6
2
3
4
5
Fault
Memory
1
10
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
1
2
3
4
1
2
3
1
2
5
6
1
2
1
6
2
3
4
5
Fault
Memory
1
11
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
1
2
3
4
5
1
2
3
4
1
2
3
1
2
6
1
2
1
6
2
3
4
5
Fault
Memory
12
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
1
2
3
4
5
1
2
3
4
1
2
3
1
2
6
1
2
1
6
2
3
4
5
Fault
Memory
13
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
3
4
5
6
1
2
3
4
5
1
2
3
4
1
2
3
1
2
1
6
2
3
4
5
Fault
Memory
14
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
3
4
5
6
1
2
3
4
5
1
2
3
4
1
2
3
1
2
1
6
2
3
4
5
Fault
Memory
15
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
1
2
3
4
5
6
1
1
2
3
4
5
6
1
2
3
4
5
1
2
3
4
2
1
6
2
3
4
5
Fault
Memory
16
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
1
2
3
4
5
6
1
1
2
3
4
5
6
1
2
3
4
5
1
2
3
4
2
1
6
2
3
4
5
Fault
Memory
17
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
2
3
4
5
6
1
2
1
2
3
4
5
6
1
1
2
3
4
5
6
1
2
3
4
5
1
6
2
3
4
5
Fault
Memory
18
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
2
3
4
5
6
1
2
1
2
3
4
5
6
1
1
2
3
4
5
6
1
2
3
4
5
1
6
2
3
4
5
Fault
Memory
19
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
1
2
3
4
5
6
1
2
2
1
2
3
4
5
6
1
1
1
2
3
4
5
6
6
1
2
3
4
5
5
6
2
3
4
5
Fault
Memory
20
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
1
2
3
4
5
6
1
2
2
1
2
3
4
5
6
1
1
1
2
3
4
5
6
6
1
2
3
4
5
5
6
2
3
4
5
Fault
Memory
21
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
1
2
3
4
5
6
1
2
2
2
1
2
3
4
5
6
1
1
1
1
2
3
4
5
6
6
6
1
2
3
4
5
5
5
2
3
4
5
Fault
Memory
22
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
1
2
3
4
5
6
1
2
2
2
1
2
3
4
5
6
1
1
1
1
2
3
4
5
6
6
6
1
2
3
4
5
5
5
2
3
4
5
Fault
Memory
23
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
1
2
3
4
5
6
1
2
2
2
2
1
2
3
4
5
6
1
1
1
1
1
2
3
4
5
6
6
6
6
1
2
3
4
5
5
5
5
3
4
5
Fault
Memory
24
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
1
2
3
4
5
6
1
2
2
2
2
1
2
3
4
5
6
1
1
1
1
1
2
3
4
5
6
6
6
6
1
2
3
4
5
5
5
5
3
4
5
Fault
Memory
25
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
1
2
3
4
5
6
1
2
2
2
2
3
1
2
3
4
5
6
1
1
1
1
2
1
2
3
4
5
6
6
6
6
1
1
2
3
4
5
5
5
5
6
4
5
Fault
Memory
26
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
1
2
3
4
5
6
1
2
2
2
2
3
1
2
3
4
5
6
1
1
1
1
2
1
2
3
4
5
6
6
6
6
1
1
2
3
4
5
5
5
5
6
4
5
Fault
Memory
27
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
1
2
3
4
5
6
1
2
2
2
2
3
4
1
2
3
4
5
6
1
1
1
1
2
3
1
2
3
4
5
6
6
6
6
1
2
1
2
3
4
5
5
5
5
6
1
5
Fault
Memory
28
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
1
2
3
4
5
6
1
2
2
2
2
3
4
1
2
3
4
5
6
1
1
1
1
2
3
1
2
3
4
5
6
6
6
6
1
2
1
2
3
4
5
5
5
5
6
1
5
Fault
Memory
29
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
1
2
3
4
5
6
1
2
2
2
2
3
4
5
1
2
3
4
5
6
1
1
1
1
2
3
4
1
2
3
4
5
6
6
6
6
1
2
3
1
2
3
4
5
5
5
5
6
1
2
Fault
Memory
30
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
31
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
32
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
1
Memory
33
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
Fault
1
Memory
34
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
1
1
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
2
3
35
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
1
1
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
2
3
36
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
1
1
1
2
2
3
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
37
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
1
1
1
2
2
3
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
38
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
1
1
1
1
2
2
2
3
3
3
5
6
1
2
1
6
2
3
4
5
Fault
Memory
4
39
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
1
1
1
1
2
2
2
3
3
3
5
6
1
2
1
6
2
3
4
5
Fault
Memory
4
40
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
1
1
1
1
1
2
2
2
2
3
3
3
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
41
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
1
1
1
1
1
2
2
2
2
3
3
3
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
42
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
43
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
4
5
6
1
2
1
6
2
3
4
5
Fault
Memory
44
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
1
1
1
1
1
1
1
2
2
2
2
2
2
3
3
3
3
3
3
4
5
6
6
2
1
6
2
3
4
5
Fault
Memory
45
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
1
1
1
1
1
1
1
2
2
2
2
2
2
3
3
3
3
3
3
4
5
6
6
2
1
6
2
3
4
5
Fault
Memory
46
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
3
3
3
3
3
3
3
4
5
6
6
6
1
6
2
3
4
5
Fault
Memory
47
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
3
3
3
3
3
3
3
4
5
6
6
6
1
6
2
3
4
5
Fault
Memory
48
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
2
3
4
5
Fault
Memory
49
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
2
3
4
5
Fault
Memory
50
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
2
3
4
5
Fault
Memory
51
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
2
3
4
5
Fault
Memory
52
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
3
4
5
Fault
Memory
53
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
3
4
5
Fault
Memory
54
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
6
4
5
Fault
Memory
55
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
6
4
5
Fault
Memory
56
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
6
4
5
Fault
Memory
57
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
6
4
5
Fault
Memory
58
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
6
4
5
Fault
Memory
59
spcl.inf.ethz.ch
@spcl_eth
Exercise:
Assume a machine has a memory capacity of four physical frames. A process accesses virtual pages in the
following order 1,2,3,4,5,6,1,2,1,6,2,3,4,5 how many page faults can you observe if the FIFO page replacement
strategy is used? What is the optimum for this case? Assume that the memory is empty initially.
OPTIMAL
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
4
5
6
6
6
6
6
6
6
4
5
Fault
Memory
FIFO
Access
1
2
3
4
5
6
1
2
1
6
2
3
4
5
1
2
3
4
5
6
1
2
2
2
2
3
4
5
1
2
3
4
5
6
1
1
1
1
2
3
4
1
2
3
4
5
6
6
6
6
1
2
3
1
2
3
4
5
5
5
5
6
1
2
Fault
Memory
The optimal solution could not be unique!
60
spcl.inf.ethz.ch
@spcl_eth
Question:
A machine supports virtual memory and uses 32 bit addresses and 4 KB pages. Assume the virtual memory
system uses a single level page table, each page table entry is four bytes in size. A process uses 512 pages.
How much space is required for the page table datastructure?
- The size of the page table is independent of the amount of used pages
232
- Solution: 212 × 4 = 222 = 4𝑀𝐵
Question:
What are benefits of increasing the page size? And benefits of decreasing the page size?
Large pages → more TLB hits
Small pages → less internal fragmentation
Question:
Describe a mechanism by which one segment could belong to the address space of two different
processes
Since segment tables are a collection of base–limit registers, segments can be shared
when entries in the segment table of two different processes point to the same
physical location. The two segment tables must have identical base pointers, and the
shared segment number must be the same in the two processes.
61
spcl.inf.ethz.ch
@spcl_eth
Question:
Outline a design for hard-links in the FAT filesystem. Make sure your implementation behaves correctly if links
are deleted.
The FAT filesystem also does such a seperation, each filename references the first
cluster which contains the data of this file, subsequent clusters are found via the file
allocation table.
Deletion?
In order to correctly deal with deletions we need to introduce reference counting: only
when all links to a cluster are deleted, we can free the cluster.
Question:
I/O can be done using busy waiting, interrupts, and direct memory access (DMA). Name an advantage
and disadvantage for each.
•
•
•
Busy waiting means the CPU is actively reading a register or memory region until
the contents change. It has a low latency but occupies the CPU.
Interrupts have a higher latency, but the CPU is not occupied while waiting for one.
DMA allows to transfer large amounts of data without involving the CPU. DMA
requires memory pages to be pinned.
62