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

Similar documents
CS140 Operating Systems Final Review. Mar. 13 th, 2009 Derrick Isaacson

Today: Protection! Protection!

Chapter 11: Implementing File Systems

CS 537 Fall 2017 Review Session

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

Portland State University ECE 587/687. Virtual Memory and Virtualization

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

CS 416: Operating Systems Design April 22, 2015

Advanced file systems: LFS and Soft Updates. Ken Birman (based on slides by Ben Atkin)

GFS: The Google File System

NFS: Naming indirection, abstraction. Abstraction, abstraction, abstraction! Network File Systems: Naming, cache control, consistency

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES

JOURNALING FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 26

CSE 153 Design of Operating Systems

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

COS 318: Operating Systems. Virtual Memory and Address Translation

Operating Systems. Lecture File system implementation. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

Da-Wei Chang CSIE.NCKU. Professor Hao-Ren Ke, National Chiao Tung University Professor Hsung-Pin Chang, National Chung Hsing University

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

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

COMP 3361: Operating Systems 1 Final Exam Winter 2009

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

Operating Systems. Operating Systems Professor Sina Meraji U of T

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission 1

Ext3/4 file systems. Don Porter CSE 506

CS370 Operating Systems

Storage and File System

COS 318: Operating Systems. File Systems. Topics. Evolved Data Center Storage Hierarchy. Traditional Data Center Storage Hierarchy

CS5460: Operating Systems Lecture 20: File System Reliability

CSC369 Operating Systems. Spring 2007

To Everyone... iii To Educators... v To Students... vi Acknowledgments... vii Final Words... ix References... x. 1 ADialogueontheBook 1

Storage and File Hierarchy

2 nd Half. Memory management Disk management Network and Security Virtual machine

Topics. File Buffer Cache for Performance. What to Cache? COS 318: Operating Systems. File Performance and Reliability

COS 318: Operating Systems

Main Points of the Computer Organization and System Software Module

Page 1. Recap: File System Goals" Recap: Linked Allocation"

CS 318 Principles of Operating Systems

Computer Systems Laboratory Sungkyunkwan University

Background. 20: Distributed File Systems. DFS Structure. Naming and Transparency. Naming Structures. Naming Schemes Three Main Approaches

Operating Systems Design Exam 2 Review: Spring 2011

File System Performance (and Abstractions) Kevin Webb Swarthmore College April 5, 2018

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

Network File System (NFS)

Network File System (NFS)

Chapter 12 File-System Implementation

CSE380 - Operating Systems

18-447: Computer Architecture Lecture 16: Virtual Memory

24-vm.txt Mon Nov 21 22:13: Notes on Virtual Machines , Fall 2011 Carnegie Mellon University Randal E. Bryant.

references Virtualization services Topics Virtualization

Review: FFS background

CS 318 Principles of Operating Systems

PERSISTENCE: FSCK, JOURNALING. Shivaram Venkataraman CS 537, Spring 2019

Lecture 21: Reliable, High Performance Storage. CSC 469H1F Fall 2006 Angela Demke Brown

CS140 Final Review. March 16, 2018

Journaling versus Soft-Updates: Asynchronous Meta-data Protection in File Systems

Lecture 4: Memory Management & The Programming Interface

CS370 Operating Systems

CSE 120 Principles of Operating Systems

Chapter 11: Implementing File

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Chapter 11: Implementing File Systems. Operating System Concepts 9 9h Edition

CSCE 410/611: Virtualization

What is a file system

FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23

Operating Systems. File Systems. Thomas Ropars.

OPERATING SYSTEM. Chapter 12: File System Implementation

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

(a) Which of these two conditions (high or low) is considered more serious? Justify your answer.

File systems CS 241. May 2, University of Illinois

Chapter 13: I/O Systems

DISTRIBUTED FILE SYSTEMS & NFS

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

Midterm II December 4 th, 2006 CS162: Operating Systems and Systems Programming

Chapter 11: Implementing File Systems

FILE SYSTEMS, PART 2. CS124 Operating Systems Fall , Lecture 24

CSE 120 Principles of Operating Systems

Last Class: Memory management. Per-process Replacement

CS 318 Principles of Operating Systems

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

CS140 Operating Systems and Systems Programming Final Exam

ESE 333 Real-Time Operating Systems 163 Review Deadlocks (Cont.) ffl Methods for handling deadlocks 3. Deadlock prevention Negating one of four condit

File Systems Management and Examples

I/O and file systems. Dealing with device heterogeneity

Review: FFS [McKusic] basics. Review: FFS background. Basic FFS data structures. FFS disk layout. FFS superblock. Cylinder groups

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission 1

File Systems. Chapter 11, 13 OSPP

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

CS140 Operating Systems Midterm Review. Feb. 5 th, 2009 Derrick Isaacson

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

COS 318: Operating Systems. Journaling, NFS and WAFL

GFS: The Google File System. Dr. Yingwu Zhu

Chapter 11: File System Implementation. Objectives

Block Device Scheduling. Don Porter CSE 506

ECE 598 Advanced Operating Systems Lecture 18

Block Device Scheduling

CSE 120 Principles of Operating Systems

EECS 482 Introduction to Operating Systems

Transcription:

Administrative Details CS 140 Final Review Session Final exam: 12:15-3:15pm, Thursday March 18, Skilling Aud (here) Questions about course material or the exam? Post to the newsgroup with Exam Question in subject line Plan For Today Lightning-quick review of pre-midterm course topics Slightly more in depth review of postmidterm topics Time for questions at the end Pre-Midterm Concurrency + Synchronization primitives What hardware support do you need? Scheduling Fairness, response time, throughput, etc. Many approaches FCFS, Priority, BSD sched., balanced virtual time, etc. etc. etc Pre-Midterm, cont. Linking/loading Static vs. dynamic Virtual memory HW support: page table management, TLB? Handling page faults, eviction strategies Lots of cool tricks you can play Use mprotect to trigger faults on write to page, etc. Disks + I/O How slow are they? Many orders of magnitude slower than CPU registers, cache, RAM How do you know when I/O completes? Polling vs. Interrupts Polling ties up CPU Context switches to handle interrupts very expensive Depends on expected wait time

Optimizing Disk Accesses Seek time + rotational delay >> time to read a block once head is positioned Sequential accesses amortize cost Stay in same cylinder group (no head seek necessary) Organize accesses intelligently E.g. elevator algorithm Don t tie up CPU during I/O Special hardware (DMA) can handle data transfer File Systems Goals Space utilization, optimal disk access patterns, robustness (crash recovery) Flexibility: huge files, huge numbers of files Organize files in coherent fashion Evaluating performance Sequential access? Random access? Metadata overhead? Simple FSs Extent-based Pros: simple, files are sequential Cons: fragmentation Linked Pros: disk usage, low overhead Cons: really bad random access, and sequential access can be bad Indexed (multilevel?) Pros: disk usage, better random access Cons: fixed max file size/disk size? A better FS: FFS Uses bitmap for fast allocation Space allocated in large blocks for improved locality Can be split into fragments Prefer allocations in same cylinder group for related data Downsides? Needs synchronous metadata writes (more on this later) Crash Recovery Run program (fsck) to repair file system after crash and ensure consistency Goal: design FS so that fsck can always recover system, and can do so efficiently Crash Recovery, cont. Problem: crash during update to metadata can leave filesystem in unrecoverable state (if we re not careful) Ordered updates Make sure writes go out to disk in particular order Needs to be synchronous (slow)

Crash Recovery, cont. A better way: soft updates Store information about dependencies Can solve cyclic dependency problems May require rollbacks Another way: journaling Write operations out to log before actually doing them Crash recovery: replay log Periodically do checkpoints A better on-disk data structure So far we ve seen: Linked list, index (single, multilevel) Now B+ trees! Generalization of binary trees Insert, delete operations can be very complicated In fact many implementations cut corners here Goals: don t chase many pointers, get lots of useful data with each disk block read Networking Layered model Link ( Network ( Transport ( Application ) ) ) Link layer: MAC Ethernet, or wireless Network layer: IP Transport: TCP or UDP Differences? Sockets: abstractions for communication Networked Filesystems Saw a few different approaches Mostly talked about NFS and AFS Stateless vs. Stateful Caching strategies Polling, callbacks, leases When are writes visible to other clients? NFS Goals: Unix semantics, crash recovery, performance Uses RPCs (remote procedure calls) to manipulate vnode objects on server Caching How do we know if a cached file is stale? Mtime and ctime attributes, before and after (in v3) Client may not have to flush cache In v3, fine grain controls like expected write stability (do we want to wait until data is guaranteed not to disappear?) AFS: a different approach Any AFS volume available under /afs/ directory All writes cached locally until file closed Can cause some issues Originally cached entire file (expensive to open large file) Actual location of file should be transparent to client Volume migration: move to different server with minimal disruption

Protection Think of a matrix of users and objects Cell(i,j) specifies rights of user i to access object j Unix slices on columns Permissions stored with object Root user is the kitchen sink in Unix Can do anything Root, setuid, TOCTOU bugs Why do we need setuid programs? Login as different user, change password, etc. Setuid programs very tricky to get right! Time of check to time of use bugs (TOCTOU) Malicious user tricks process with elevated privilege by racing to change file to symlink (as an example) Ptrace bugs Not allowed to ptrace a setuid program, but what if they drop privileges? Memory could reveal secret key, e.g. Confused deputy Study examples carefully from lecture and make sure you understand the problems Capabilities Slice access control matrix along rows Keys for access maintained with user Unfortunately, little momentum to switch to radically different model Security Two concepts Secrecy: Untrusted users cannot read secret data A process should not simultaneously read classified file and write to unclassified file Integrity: Low-integrity users cannot pollute highintegrity data Modeled as a lattice Consult lecture notes/wikipedia for more details on lattices Flask architecture: separate security policy from implementation Specify policy, then system enforces it Virtualization Abstract the hardware Tons of applications Fault isolation Legacy code support CPU utilization/sharing Debugging Security?? (maybe not) Implementing Memory Accesses Add another level of indirection Physical page -> Machine Page Terminology can get really confusing here Virtual address/page: virtual memory managed by guest OS Physical address: address that guest OS uses to access memory Machine address/page: address of memory on the host machine This mapping is the shadow page table Tricky problems: want to avoid as many faults as possible, but need to keep page tables in sync

Binary Translation Interpreting and emulating each instruction is too slow Some code can actually just be run on the host CPU Most user code Kernel code is trickier Can use privileged operations Once translated, might be a different size Branches and jumps might not be safe Memory Management Double LRU paging: bad! (Why?) Random works well in VMM Operating Systems are greedy Will use all the memory available Different VMs can share memory (what if somebody writes to it?) How can the VMM reclaim memory? Balloon driver in guest hogs memory VMM can now use this space Which VM to reclaim from? Idle memory tax Questions?