CS153: Final Review1. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

Similar documents
Final Review. Geoffrey M. Voelker. Final mechanics Memory management Paging Page replacement Disk I/O File systems Advanced topics

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems

CSC369 Operating Systems. Spring 2007

CS153: Memory Management 1

Architectural Support. Processes. OS Structure. Threads. Scheduling. CSE 451: Operating Systems Spring Module 28 Course Review

CSE 451: Operating Systems. Section 10 Project 3 wrap-up, final exam review

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

MEMORY: SWAPPING. Shivaram Venkataraman CS 537, Spring 2019

Design of Operating System

Final Exam Preparation Questions

Module 1: Basics and Background Lecture 4: Memory and Disk Accesses. The Lecture Contains: Memory organisation. Memory hierarchy. Disks.

Agenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements

EECS 482 Introduction to Operating Systems

Chapter 8. Virtual Memory

CS 537 Fall 2017 Review Session

CS153: Communication. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

CS 61C: Great Ideas in Computer Architecture. Virtual Memory

3/3/2014! Anthony D. Joseph!!CS162! UCB Spring 2014!

Virtual Memory. Chapter 8

Today: Protection! Protection!

CS153: Process. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

Paging. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Virtual Memory I. Jo, Heeseung

Operating Systems. Operating Systems Sina Meraji U of T

CS 318 Principles of Operating Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

CS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement"

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches

Locality. CS429: Computer Organization and Architecture. Locality Example 2. Locality Example

ECE7995 Caching and Prefetching Techniques in Computer Systems. Lecture 8: Buffer Cache in Main Memory (I)

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg

!! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced?

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

Today: Secondary Storage! Typical Disk Parameters!

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

CS 153 Design of Operating Systems

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Final Exam Questions (document version 1.0) WITH SELECTED SOLUTIONS

Lecture 12: Demand Paging

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Today: Protection. Sermons in Computer Science. Domain Structure. Protection

Caches (Writing) P & H Chapter 5.2 3, 5.5. Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University

Operating Systems Design Exam 2 Review: Spring 2011

Memory Management! Goals of this Lecture!

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Systems Programming and Computer Architecture ( ) Timothy Roscoe

CS 416: Opera-ng Systems Design March 23, 2012

CS356: Discussion #9 Memory Hierarchy and Caches. Marco Paolieri Illustrations from CS:APP3e textbook

Page 1. Goals for Today" TLB organization" CS162 Operating Systems and Systems Programming Lecture 11. Page Allocation and Replacement"

CSE 141 Computer Architecture Spring Lectures 17 Virtual Memory. Announcements Office Hour

Administrative Details. CS 140 Final Review Session. Pre-Midterm. Plan For Today. Disks + I/O. Pre-Midterm, cont.

Paging. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CS 153 Design of Operating Systems Spring 18

Memory Management. Goals of this Lecture. Motivation for Memory Hierarchy

Virtual or Logical. Logical Addr. MMU (Memory Mgt. Unit) Physical. Addr. 1. (50 ns access)

CS 153 Design of Operating Systems Winter 2016

[537] Fast File System. Tyler Harter

Memory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources

CS4411 Intro. to Operating Systems Final Fall points 10 pages

b. How many bits are there in the physical address?

CSE 153 Design of Operating Systems

Virtual Memory Management

Memory Management! How the hardware and OS give application pgms:" The illusion of a large contiguous address space" Protection against each other"

John Wawrzynek & Nick Weaver

Administrivia. CMSC 411 Computer Systems Architecture Lecture 8 Basic Pipelining, cont., & Memory Hierarchy. SPEC92 benchmarks

CSF Cache Introduction. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005]

VIRTUAL MEMORY. Operating Systems 2015 Spring by Euiseong Seo

Lecture 15: Caches and Optimization Computer Architecture and Systems Programming ( )

Paging algorithms. CS 241 February 10, Copyright : University of Illinois CS 241 Staff 1

Caches (Writing) P & H Chapter 5.2 3, 5.5. Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University

CS 318 Principles of Operating Systems

Swapping. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CS 153 Design of Operating Systems

Address spaces and memory management

Midterm Exam #2 Solutions April 20, 2016 CS162 Operating Systems

LECTURE 12. Virtual Memory

Swapping. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Operating Systems. Week 9 Recitation: Exam 2 Preview Review of Exam 2, Spring Paul Krzyzanowski. Rutgers University.

CS 550 Operating Systems Spring File System

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

I/O Management and Disk Scheduling. Chapter 11

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

CS 5523 Operating Systems: Memory Management (SGG-8)

Fall COMP3511 Review

Computer Architecture. Memory Hierarchy. Lynn Choi Korea University

VIRTUAL MEMORY READING: CHAPTER 9

Memory Hierarchy. Goal: Fast, unlimited storage at a reasonable cost per bit.

ECE331: Hardware Organization and Design

MC7204 OPERATING SYSTEMS

Operating Systems Virtual Memory. Lecture 11 Michael O Boyle

Portland State University ECE 587/687. Caches and Memory-Level Parallelism

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

CS370 Operating Systems

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

STORING DATA: DISK AND FILES

Transcription:

1 CS153: Final Review1 Chengyu Song Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

2 Administrivia Final exam Thursday, June 15, 3:00 p.m. - 6:00 p.m. In this classroom (Sproul Hall 1102) Read questions carefully! Closed book. No additional sheets of notes DO NOT CHEAT

3 Administrivia (cont.) Scope Most topics covered after midterm Memory management, file systems, access control Virtualization, communication, attacks&defenses One problem from pre-midterm Either alternation or reader/writer Based on lecture and textbook ( Preparation on the class schedule) Keys for HW2 and HW3 will be posted tomorrow

4 Overview Virtual address space and address translation Paging and optimizations Memory hierarchy and cache replacement Disk I/O File systems: abstraction and disk layout Access control Advanced topics: Shared memory, copy-on-write, memory-mapped file, FFS, JFS, LFS, RAID, IPC, RPC, attacks&defenses

5 Memory management Abstractions and operations Virtual address, read/write/execute Objectives Simplify programming: where the program will be loaded Sharing and isolation Challenges and good performance metrics Fragmentations: internal and external Speed: translation and context switch

6 Virtual address space Fixed partitions: base register + fixed size Fastest translation/context switch, large internal fragmentation Variable partitions: based register + limit Fast translation/context switch, large external fragmentation Segmentation: selector + segment table Similar to variable partitions with less external fragmentation Paging : page tables No external fragmentation, acceptable internal fragmentation

7 Paging address translation Virtual address has two parts: virtual page number and offset Virtual page number (VPN) is an index into a page table Page table determines page frame number (PFN) Physical address is PFN::offset

8 Page table entries (PTEs) +---------------------+-----+----+-+-+-+ Page Frame Number... PROT R M V +---------------------+-----+----+-+-+-+ <---- 20 bits ----> 4b 1 1 1 What are the purpose of PTE bits?

9 Multi-level page tables Goal: reduce memory cost of page tables Virtual addresses (VAs) have several parts: 1st level page number, 2nd level page number,..., and page offset First few levels of page tables map page number to next level page table The last level page tables maps the last level page number to physical page Offset indicates where in physical page address is located

Intel IA32e translation (from manual) 10

11 Translation Lookaside Buffers (TLB) Caches translation results Fully associative cache (all entries looked up in parallel) Leverages program locality Managed by hardware (x86) or software

Memory hierarchy 12

13 Caches & Locality A smaller, faster storage device that acts as a staging area for a subset of the data in a larger, slower device. Cache works because of locality : programs tend to use data and instructions with addresses near or equal to those they have used recently Temporal locality: recently referenced items are likely to be referenced again in the near future Spatial locality: items with nearby addresses tend to be referenced close together

14 Cache misses Cold (compulsory) miss Cold misses occur because the cache is empty. Conflict miss When mapping a larger set of blocks at level k+1 to a smaller subset of blocks at level k, multiple data objects will map to the same block. Capacity miss -> replacement policy Occurs when the set of active cache blocks ( working set ) is larger than the cache.

15 Cache replacement policies The goal of the replacement algorithm is to reduce the miss rate The best item to evict is the one never be accessed again Belady's algorithm: replace the item that will not be used for the longest time in the future ( how? ) FIFO: Belady's anomaly LRU: reference count Scanning: check ref bit in every valid PTE LRU clock: replace page that is "old enough"

16 Disks Physical disk structure Platters, surfaces, tracks, sectors, cylinders, arms, heads Disk interface How does the OS make requests to the disk? Disk performance What steps determine disk request performance? What are seek, rotation, transfer?

17 Disk scheduling How can disk scheduling improve performance? What are the issues in disk scheduling? Response time, throughput, fairness FCFS: do nothing SSTF: "starvation" SCAN, C-SCAN: long wait time for edge blocks

18 Files What is a file? What operations are supported? What properties do they have? What are file access methods? Why is file type?

Basic file operations 19

20 Directories What is a directory? What are they used for? How are they implemented? What is a directory entry? How are directories used to do path name translation?

Basic directory operations 21

22 File system layouts What are file system layouts used for? What are the general strategies? Contiguous, linked, indexed? What are the tradeoffs for those strategies? How do those strategies reflect file access methods?

23 Unix inodes What is an inode? How are inodes different from directories? How are inodes and directories used to do path resolution, find files?

24 FS performance optimization Disk reads and writes take order of milliseconds Very slow compared to CPU and memory speeds How to speed things up? File buffer cache Cache writes Read ahead

25 Access control What is access control Goals and principles Access control models DAC: access control matrix, ACLs, Capabilities What are the advantages/disadvantages of each? Owner, group, and root User and process MAC and sandbox

26 For next class... Example problems