CSC369 – tutorial 6: Midterm review

Slides:



Advertisements
Similar presentations
Operating Systems Chapter 6.
Advertisements

HW/Study Guide. Synchronization Make sure you understand the HW problems!
PA0 due today Anyone tried to submit?. Scheduling Workload assumptions Arrive time, run time, I/O, etc. Policies: FIFO, SJF, STCF, RR, MLFQ, and lottery.
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Day 20 Memory Management. Assumptions A process need not be stored as one contiguous block. The entire process must reside in main memory.
CS 153 Design of Operating Systems Spring 2015
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Memory Management Design & Implementation Segmentation Chapter 4.
Multiprocessing Memory Management
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
Virtual Memory. Why do we need VM? Program address space: 0 – 2^32 bytes –4GB of space Physical memory available –256MB or so Multiprogramming systems.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Operating System Machine.
Computer Organization and Architecture
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Chapter 10 Operating Systems.
Instructor: Yuzhuang Hu Memory Hierarchy.
Problems in Memory Management CS 1550 Recitation October 9 th, 2002 The questions in this slide are from Andrew S. Tanenbaum's textbook page 264.
Chapter 10 Operating Systems.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
10-1 Software Categories Application software Software written to address specific needs—to solve problems in the real world Word processing programs,
4.3 Virtual Memory. Virtual memory  Want to run programs (code+stack+data) larger than available memory.  Overlays programmer divides program into pieces.
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
Consider the Java code snippet below. Is it a legal use of Java synchronization? What happens if two threads A and B call get() on an object supporting.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
CSC 360, Instructor Kui Wu Memory Management I: Main Memory.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
CE Operating Systems Lecture 8 Process Scheduling continued and an introduction to process synchronisation.
Process Control Management Prepared by: Dhason Operating Systems.
MIDTERM REVIEW CSCC69 Winter 2016 Kanwar Gill. What is an OS? What are processes and threads? Process states? Diagram showing the state changes What data.
Chapter 18 Paging Chien-Chung Shen CIS/UD
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Lecture 6 The Rest of Scheduling Algorithms and The Beginning of Memory Management.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
CS 140 Lecture Notes: Virtual Memory
Networks and Operating Systems: Exercise Session 3
Processes and threads.
Virtual Memory Chapter 7.4.
Virtualization Virtualize hardware resources through abstraction CPU
CPU SCHEDULING.
CS703 - Advanced Operating Systems
Day 19 Memory Management.
Chapter 3: Processes.
CSC 322 Operating Systems Concepts Lecture - 16: by
CS510 Operating System Foundations
CPSC 457 Operating Systems
Process management Information maintained by OS for process management
Lecture 28: Virtual Memory-Address Translation
CS 140 Lecture Notes: Virtual Memory
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Paging Lecture November 2018.
Segmentation Lecture November 2018.
COT 4600 Operating Systems Spring 2011
Chapter 15 – Part 1 The Internal Operating System
CS 143A Quiz 1 Solution.
Lecture 32 Syed Mansoor Sarwar
The Operating System Machine Level
CPSC 457 Operating Systems
CS 140 Lecture Notes: Virtual Memory
Operating Systems.
Virtual Memory Hardware
Lecture 35 Syed Mansoor Sarwar
Process.
Paging Memory Relocation and Fragmentation Paging
CS 140 Lecture Notes: Virtual Memory
4.3 Virtual Memory.
Chapter 8 & 9 Main Memory and Virtual Memory
Chapter 3: Process Management
Presentation transcript:

CSC369 – tutorial 6: Midterm review TA: Trevor Brown Slides: http://www.cs.utoronto.ca/~tabrown/csc369/week6.ppt

Paging memory

Paging Memory Address Translation This is a test. bits for page number = 22 bit virtual address - 16 bits offset (for 64k page size) = 6, so number of pages is 2^6 or 64. vaddr 0x03BEEF is vpn 0x03 with offset 0xBEEF. Page table for virtual page number (vpn) 3 is frame 0xF0, so phys addr is 0xF0BEEF

Paging Memory Address Translation (continued) phys addr 0x2CF070 is physical frame 0x2C with offset 0xF070. Searching the page table, we find frame 0x2C is allocated for virtual page number 1, so vaddr is 0x01F070 if physical address are 32 bits, and we still need 16 bits for offset, then there are 16 bits for physical page number, giving 2^(16) = 64k physical page frames extra time to look up entries in page tables (extra memory accesses) or extra memory space to store page tables for translation

Allocation and fragmentation Paging Memory Answer:

Synchronization

Unprotected counter increments Synchronization

Synchronization Data races Are there any data races in this code? If so: how can they occur, and how can we fix them?

Synchronization Data races (continued) Answer: Suppose throwing 128 CPUs at this code doesn’t improve performance much. Why would that be the case?

Synchronization Data races (continued) Answer: Basically: The running time of show_money is tiny, compared thread creation time, and we can only create one thread at a time. (show_money is only a few instructions) Lesson: Concurrent jobs have to be substantial enough to warrant thread creation.

CPU/thread Scheduling

CPU/Thread Scheduling Multi-level Feedback Queue (MLFQ) CPU/Thread Scheduling Consider a 2-level MLFQ: Level 0 (L0): round-robin with quantum=2 Level 1 (L1): first-come-first-served New processes go to back of L0. Processes finished I/O burst go to back of L0. The workload: Three processes (P0, P1, P6) spawn at times 0, 1, 6. Each process does: CPU burst for 5 I/O burst for 3 CPU burst for 1 The problem: for the first 20 time units, for each process, write one of the following: [blank], new, [has] CPU, [is] preempt[ed], [is on queue] L0 / L1 / IO, exit.

CPU/Thread Scheduling Multi-level Feedback Queue (MLFQ) CPU/Thread Scheduling