Final Exam Part 2 Flashcards

1
Q

The two things you need for any replacement algorithm:

A
  1. main memory size (ex. 4 frames)

2. sequence of pages that a running program request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Reason why the performance metric for replacement algorithims is based on the hit rate:

A

the higher the hit rate, the lower the response time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

FIFO/FCFS (Replacement algorithm)

A

First In First Out/First Come First Serve; The order in which the page request occur is the order in which they are executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The best replacement policy is _____

A

OPT (Optimum Policy)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

OPT (Replacement algorithm)

A

Optimum Policy; look into the future and remove the policy that is not used in the near future

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

OPT makes sense to use in real life (T or F)

A

False. how would you predict the future

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

LRU (Replacement algorithm)

A

Least Recently Used; the page that was used the least recently is replaced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

LRU is never implemented in real life systems (T or F)

A

False. some version of LRU is implemented in all file system caches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

MRU (Replacement algorithm)

A

Most Recently Used; the page that was used the most recently is replaced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where is MRU implemented?

A

lower level cache, like storage cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why is LRU never implemented as a memory page replacement policy?

A

The OS has to be called on every page hit to rearrange the replacement queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

NUR (Replacement algorithm)

A

Not Used Recently; has a reference bit and a pointer. The reference bit is set to 1 every time a page is reference and the pointer points to the next frame to be replaced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the relationship between NUR and LRU

A

NUR is a LRU approximation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Goal of OS replacement schemes

A
  1. lower page faults

2. ensures that the CPU is utilized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When CPU utilization is low, the OS loads more programs into MM to keep CPU busy

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

thrashing

A

when a program spends more time page faulting than executing; indicated too few pages in MM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

solution to thrashing

A

ensure that every program in MM has the minimum # of pages; Working Set Model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Working Set Model

A

working set of a program: set of pages of his program that must be in MM while the program is executing; implies that the pages in the working set cannot be in the replacement queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Most OS use:

A

working set model and some version of NUR replacement policy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

requirement for working set model

A

working set + replacement queue must be less than or equal to the number of MM frames

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

disk access time =

A

seek time + rotational latency + transfer time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

seek time =

A

time for the read/write head to move to the correct cylinder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

rotational latency =

A

time for the correct sector to arrive under the head

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

transfer time =

A

time to transfer data to/from the disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

the performance metric for disk scheduling is based upon

A
  1. minimize response time
  2. minimize seek time
  3. minimize distance moved by the disk head
26
Q

FIFO (Disk Scheduling Policy)

A

First Come First Serve; the order in which requests are made are the order in which they are served

27
Q

SSTF (Disk Scheduling Policy)

A

Shortest Seek Time First; the next request to be served is determined by how far it has to seek to get the the next request

28
Q

Disadvantages of FIFO and SSTF

A
  1. wear-and-tear due to back and forth movement of the disk head
  2. could lead to starvation
29
Q

SCAN (Disk Scheduling Policy)

A

serves the first request and then moves to the closest end, processing rquests along the way, then serves requests as it moves to the next end

30
Q

CSCAN (Disk Scheduling Policy)

A

service requests while disk head is always moving in one direction

31
Q

LOOK (Disk Scheduling Policy)

A

equivalent to SCAN where the disk head does not go all the way to the end tracks unless there are requests on those tracks

32
Q

CLOOK (Disk Scheduling Policy)

A

equivalent to CSCAN where the disk head does not go all the way to the end tracks unless there are requests on those tracks

33
Q

RAID stands for

A

Redundant Array of Indepenant (Inexpensive) Disks

34
Q

Benefits of RAID

A
  1. multiple disks that are treated a 1 unit by the OS
  2. disks crash: more disks mean higher failure rate; but redundancy is included to ensure that failure of a disk does not result in data loss
  3. improve performance by parallelism: data distributed across all disks, so queue length at each disk is smaller
35
Q

RAID 0

A

no redundancy; data are written across all the disks (stripe units)

S1 S2 S3 S4
S5 S6 S7 S8

36
Q

RAID 1

A

mirroring; every disk has a copy, no striping

D1 D1’ D2 D2’

37
Q

RAID 1 read/write

A

write: has to write to 2 disks
read: can read from either disk (faster)

38
Q

RAID 10

A

combines striping of RAID 0 and mirroring of RAID 1

S1 S1’ S2 S2’
S3 S3’ S4 S4’

39
Q

RAID 10 disadvantage

A

capacity is 1/2 the disk space

40
Q

RAID 5

A

parity blocks are used to rebuild corrupt blocks

S1 S2 S3 P1
S4 S5 P2 S6
S7 P3 S8 S9

41
Q

How are parity blocks saved

A

Cascading XORs

42
Q

disk address

A

cylinder/track #, sector #

43
Q

maps LA -> PA

A

disk controller

44
Q

keeps track of LAs

A

OS

45
Q

your file is _______ if contiguous blocks of your file are not stored contiguously on disk

A

fragmented

46
Q

performance will __________ if the file is fragmented

A

decrease

47
Q

What is a file?

A

User viewpoint: a sequence of bytes
OS viewpoint: a sequence of file blocks
Disk viewpoint: does not see files

48
Q

all programs had automatic access to 3 devices:

A
  1. stdin
  2. stdout
  3. stderr
49
Q

file metadata

A

inode

50
Q

files identified by:

A

inode #

51
Q

information stored by inode:

A
  1. owner
  2. protection settings
  3. times: creation time, modification time, last access time
  4. size of file
  5. location of disk where the file’s data blocks are stored
  6. open count: # of open copies
  7. link count: # of links to this file
52
Q

file system layout on the disk:

A

boot block, super blocks, inode list, data blocks

53
Q

boot block

A

boostrap code which points to where the OS is stored on disk

54
Q

super blocks

A

layout of the file system is stored here: # of blocks, start of inode list, # of nodes, start of data blocks, list of free blocks

55
Q

inode list

A

same sized inodes

56
Q

indexed block file allocation scheme

A

inode -> index block -> data block

OR

inode -> index block -> index block -> data block

57
Q

What is a directory?

A

a special file that shows the correspondence between file name and inode number

58
Q

. and .. inode numbers are he same in the root directory (T or F)

A

True

59
Q

cwd

A

current working directory

60
Q

cwd = u1
open(“/usr/u1/file1”, O_RDWR)
How many disk accesses?

A

5 disk accesses

61
Q

cwd = U1
open(“file1”, O_RDWR)
How many disk accesses?

A

1 disk access