CS 423 – Operating Systems Design
Lecture 41 – Operating System –
Material Review
Klara Nahrstedt
Fall 2011
Administrative
HW2 – ongoing, due December 7
(Wednesday), 11:59pm – midnight
Office Hours during Final Exam Week:
◦ Instructor: 3104 SC Wednesday 10-12
◦ TAs: will be advertised on the newsgroup
cs423, Fall 2011
Administrative – MP4 Intel
Competition Results 1st prize
◦ Philip Jurik, Matthew Jurik
2nd prize
◦ Jared Lambert, Sean Adams, Kathryn Malinowski
3rd prize
◦ Zhijin Li, Hui Liu, Haichuan Wang
Congratulation to winners and all finalists of the Intel competition. Great Job!!
cs423, Fall 2011
Administrative
Return Android Phones
◦ Deadline: before or by December 16,
Friday
◦ Room: 1330 Siebel Center,
◦ To Whom: Paula Grotbo / Rick van Hook
◦ When: During Office Hours of the Purchase /
Receiving and Inventory Office
cs423, Fall 2011
Administrative
¼ Unit Projects Delivery
Anticipated (and Preferred) Project Deadline: ◦ December 12, 5pm
Possible Extension : latest by ◦ December 16, 5pm
Delivery: by email [email protected] ◦ Format: pdf file
If your project is demo, contact me ([email protected]) for demonstration meeting during week December 12-16
cs423, Fall 2011
Final Exam
Date: Thursday, December 15
Time: 8-11am
Room: 1109 SC for on-campus Students
◦ with last name A-M (approx. 24 students in this
room)
Room: 1302 SC for on-campus Students
◦ with last name N-Z (approx. 24 students in this
room)
cs423, Fall 2011
Final Exam Rules
Few Final Exam Rules
◦ No calculator or any other electronic devices
All math can be done by hand – simple math
◦ Seating in each exam room
One space between each pair of students
◦ Closed book, closed notebook exam
◦ Bring your Student ID with you !!!!
PROCTORS WILL CHECK YOUR ID AS YOU HAND IN YOUR EXAM
◦ The exam is individual work.
◦ You should write only into the exam booklet.
1 page – both sides - Cheat Sheet allowed
cs423, Fall 2011
Grading
HW2 grades will be posted by Friday, December 16 on compass (we will aim for earlier deadline)
Final Exam (on-campus students) will be graded by Friday, December 16 ◦ We will post them as soon as possible on compass
We will aim to have Final Grades for the class by December 19, but ◦ It will depend when online-students exams arrive.
You will be able to find final grades on compass and banner systems.
The grading scale will be posted on the class newsgroup
cs423, Fall 2011
Regrading Information
Regrading of HW2, final exam is possible !!!
(no other regrading)_
Regrading period of HW2 and final exam
(hence final grade) will be
◦ During the week on January 17-20, 2012
◦ Make an appointment by email [email protected]
◦ We will meet in-face or on-line and I will look at
both documents and if any grade change happens,
I will issue regrading request to the academic
office to change your grade in banner system.
cs423, Fall 2011
How to Study for the Final Exam
Review Slides/Questions for Midterm/Midterm Review
Review Class Notes and Textbooks chapters
Review Additional Material on the web site
Review Regular Homework Problems (HW1 and HW2)
Work on Relevant Problems after each chapter in Tanenbaum
cs423, Fall 2011
Reading List
• Everything in Lecture Notes !!!
• Tannenbaum Textbook, 3rd Edition
– Section 2 – Threads 2.1-2.4
– Section 3– Memory Management 3.1- 3.6
– Section 4 – File Systems 4.1- 4.4
– Section 5 – I/O • Devices 5.1-5.3
• Disk – 5.4
• Clocks - 5.5
• Power Management – 5.8
– Section 8 – Multiple Processor Systems • Multi-processor systems 8.1,
• Multicomputers 8.2
• Virtualization 8.3
• Distributed File Systems 8.4.4, 10.6
– Section 9 – Security 9.1, 9.2, 9.3 (9.3.1-9.3.3) , 9.4, 9.5, 9.6 (9.6.1-9.6.5), 9.7 (9.7.1-9.7.3)
– Section 10 – UNIX/Linux • File Systems 10.6
• Section 12 – Symbian OS (as discussed in lecture notes)
cs423, Fall 2011
Reading List
MPs: MP1-MP3 (read through your
solutions)
Papers:
◦ “MapReduce: Simplified Data Processing on
Large Cluster”, J. Dean, S. Ghemawat, OSDI
2004
◦ “Google File System” ACM SOSP 2003
cs423, Fall 2011
Threads
(Section 2.1-2.4) Four Conditions for sharing correctly
data
◦ Mutual exclusion
◦ Bounded waiting
◦ Progress
◦ Any number of CPUs and any speed of CPUs
To show the correctness of any of thread
interleaving, one must ask if any of the
conditions is violated
cs423, Fall 2011
Threads
Peterson’s Solution
Lock Variables
TSL (Test-and-Set)
Semaphores
Producer/Consumer Problem
Mutex
Reader/Writer Locks
Monitors
Conditional Variables
cs423, Fall 2011
Question: Producer-consumer w/
semaphores mutex: ensures mutual exclusion
fullBuffers: counts the number of full buffers (initialized to 0)
emptyBuffers: counts the number of empty
buffers (initialized to N)
consumer {
While(TRUE) {
down(&emptyBuffers);
down(&mutex);
item = remove_item();
up(&mutex);
up(&emptyBuffers); }
producer {
While(TRUE) {
item = produce_item();
down(&fullBuffers);
down(&mutex);
insert_item(item);
up(&mutex);
up(&fullBuffers); }
Is this solution correct? cs423, Fall 2011
Producer/Consumer
Why do we need different semaphores for fullBuffers and emptyBuffers?
Does the order of down() calls matter in the consumer?
Does the order of the up() call matter in the consumer?
How would you rewrite this problem using monitor and conditional variable?
cs423, Fall 2011
Scheduling
Scheduling Policies
◦ FCFS
◦ Round Robin
◦ Rate Monotonic
◦ Earliest Deadline First
cs423, Fall 2011
Question
Let us assume 4 periodic processes:
◦ A with P(A) = 100ms, E(A) = 10ms
◦ B with P(B) = 100ms, E(B) = 20ms
◦ C with P(C)= 500ms, E(C ) = 100ms
◦ D with P(D) = 250ms, E(D) = 10ms
Question: Is this set of processes
schedulable with EDF or RM? If
schedulable with any of the scheduling
policies, what is the schedule?
cs423, Fall 2011
Memory Management
(4.1-4.7) • Basic Memory Management
– Mono-programming without Swapping or Paging
– Multiprogramming with Fixed Partitions
• Swapping
– Variable Partitions
• Virtual Memory Management
– Paging
– Page Table
– Multi-level Page Tables
– TLB – Translation Lookaside Buffers
– Page Replacement Algorithms • Optimal
• FIFO
• Second Chance
• LRU
• Clock Page Replacement
• Working Set cs423, Fall 2011
Page Fault Rate Curve
As page frames per VM space decrease, the page fault rate increases.
cs423, Fall 2011
Thrashing
Computations have locality.
As page frames decrease, the page frames
available are not large enough to contain
the locality of the process.
The processes start faulting heavily.
Pages that are read in, are used and
immediately paged out.
cs423, Fall 2011
Thrashing and CPU Utilization
As the page rate goes up, processes get suspended on page out queues for the disk.
the system may try to optimize performance by starting new jobs.
starting new jobs will reduce the number of page frames available to each process, increasing the page fault requests.
system throughput plunges.
cs423, Fall 2011
Working Set
the working set model assumes locality.
the principle of locality states that a program clusters its access to data and text temporally.
As the number of page frames increases above some threshold, the page fault rate will drop dramatically.
cs423, Fall 2011
I/O Section 5.1-5.5 and 5.8
I/O Devices – Controllers ◦ Memory-Mapped I/O
◦ DMA
Interrupt-driven I/O
Programmed I/O – polling – busy waiting
Device drivers
Disks ◦ RAID, disk scheduling
Clocks
Power management
cs423, Fall 2011
Questions
The disk scheduling algorithm that may cause starvation is:
◦ FCFS or SSTF or C-SCAN or LOOK ??
From the list of disk-scheduling algorithms (FCFS, SSTF, SCAN, C-SCAN, LOOK, C-LOOK), SSTF will always give the least head movement for any set of cylinder-number requests to the disk scheduler:
◦ True or False ??
The cylinder numbers on a disk are 0,1,…10. Currently, there are five cylinder requests on the disk scheduler queue in the following order: 1,5,4,8,7 and the head is located at position 2 and moving in the direction of increasing block numbers. The time to serve a request is proportional to the distance from the head to the cylinder number requested. If T(X) is the time it takes to service the requests currently in the queue using scheduling algorithm X, then:
◦ T(SSTF) < T(SCAN) < T(FCFS) or
◦ T(FCFS) < T(SSTF) < T(SCAN) or
◦ T(SSTF) < T(FCFS) < T(SCAN) or
◦ None of the above???
cs423, Fall 2011
File Systems (Section 4.1-4.4)
File Access
File Open Operation
File System Layout
Contiguous vs Linked List vs FAT vs
Indexed File Allocation
Indexed allocation = i-node allocation
Disk Space Management
cs423, Fall 2011
Questions
A UNIX i-node has 10 disk addresses for data blocks, as well as the addresses for single, double, and triple indirect blocks. If each of these holds 256 disk addresses, what is the size of the largest file that can be handled, assuming that a disk block is 1KB? ◦ 10+256+511+766
◦ 10+256+511+65,536
◦ 10+256+65,536+16,777,216
◦ None of the above
In a UNIX file-system the block size has been set to 4K. Given that the i-node blocks are already allocated on disk how many free blocks need to be found to store a file of size 64K? ◦ 16, or 17, or 64 or 65
cs423, Fall 2011
Mobile OS
Android OS
◦ Basic principles
◦ Application framework
◦ Different Features for mobile OS
Activity management
Resource management
Virtualization
Symbian OS
◦ Micro-kernel design
◦ Resource management
◦ Nano-kernel
cs423, Fall 2011
Parallel - Multi-Computer Systems
(Section 8.1, 8.2.4, 8.2.7, 8.4.4 UMA Bus-Based SMP Architecture
UMA Multiprocessor Using Crossbar Switches
Multi-core
Multi-processor Os Types
Multi-processor scheduling
Multi-computer ◦ RPC
◦ Cloud computing
◦ DFS – transfer model, naming transparency, file sharing, AFS, NFS, Google File System
cs423, Fall 2011
Question
Design your own distributed file system that would
satisfy the following assumptions (you may use any
design options from NSF, AFS, Google):
◦ Clients must be separate from servers
◦ Protocols cache at the clients only parts of file
(few file blocks)
◦ Naming scheme must be location transparent
◦ Servers are stateful
Specify the schematic view of your DFS architecture
and explain each function in each layer
cs423, Fall 2011
Question
Explain your DFS protocol for open, read, write and close operations
Explain your DFS protocol to enforce consistency on write operation
Explain your DFS protocol to handle client’s failure
cs423, Fall 2011
Parallel/Distributed Systems
Section 8. 3 Virtualization
◦ Type 1 and Type 2 Hypervisors
◦ Principles of virtualization
◦ Paravirtualization
◦ Memory virtualization
◦ I/O virtualization
◦ Virtual appliances
cs423, Fall 2011
cs423, Fall 2011
Security
Asymmetric: Public key systems
Symmetric: secrete key systems
Authentication: various methods
Attacks, viruses, worms
Capabilities and access control list
cs423, Fall 2011
Questions
What are the tradeoff between Access-list and capability list
◦ Give an example for which an access-list should be used
◦ Give an example for which an capability-list should be used
Top Related