CS 537 Fall 2017 Review Session

Similar documents
Operating Systems. Operating Systems Professor Sina Meraji U of T

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

CS 318 Principles of Operating Systems

COMP 3361: Operating Systems 1 Final Exam Winter 2009

Chapter 11: File System Implementation. Objectives

CS 318 Principles of Operating Systems

Final Exam Preparation Questions

Mass-Storage Structure

Introduction. Secondary Storage. File concept. File attributes

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

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

Long-term Information Storage Must store large amounts of data Information stored must survive the termination of the process using it Multiple proces

File Systems: FFS and LFS

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

Main Points. File layout Directory layout

File System Implementation

CS370 Operating Systems

Operating Systems. File Systems. Thomas Ropars.

Lecture 18: Reliable Storage

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

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

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

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

[537] Fast File System. Tyler Harter

CSE 153 Design of Operating Systems

CS-537: Final Exam (Fall 2013) The Worst Case

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Operating Systems CMPSC 473 File System Implementation April 10, Lecture 21 Instructor: Trent Jaeger

FFS: The Fast File System -and- The Magical World of SSDs

Physical Representation of Files

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

Chapter 10: Mass-Storage Systems

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

What is a file system

I/O and file systems. Dealing with device heterogeneity

Disc Allocation and Disc Arm Scheduling?

CS3600 SYSTEMS AND NETWORKS

Chapter 12: File System Implementation

[537] Journaling. Tyler Harter

Introduction to I/O and Disk Management

Secondary Storage (Chp. 5.4 disk hardware, Chp. 6 File Systems, Tanenbaum)

CS3600 SYSTEMS AND NETWORKS

Chapter 10: Mass-Storage Systems

Introduction to I/O and Disk Management

Module 13: Secondary-Storage Structure

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

Disk Scheduling COMPSCI 386

CS5460: Operating Systems Lecture 20: File System Reliability

EECS 482 Introduction to Operating Systems

File Systems. Chapter 11, 13 OSPP

Mass-Storage Structure

Chapter 4 File Systems. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Computer Engineering II Solution to Exercise Sheet 9

Part IV I/O System. Chapter 12: Mass Storage Structure

Chapter 10: Mass-Storage Systems

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

File Systems. CS170 Fall 2018

File Systems: Fundamentals

Tape pictures. CSE 30341: Operating Systems Principles

Part IV I/O System Chapter 1 2: 12: Mass S torage Storage Structur Structur Fall 2010

Current Topics in OS Research. So, what s hot?

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

File Systems: Fundamentals

Virtual File System -Uniform interface for the OS to see different file systems.

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

CS 4284 Systems Capstone

Example Implementations of File Systems

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters

Operating System Concepts Ch. 11: File System Implementation

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

CSE380 - Operating Systems

Today: Secondary Storage! Typical Disk Parameters!

Disk Scheduling. Based on the slides supporting the text

Lecture S3: File system data layout, naming

File systems CS 241. May 2, University of Illinois

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

File Systems. What do we need to know?

Chapter 14: Mass-Storage Systems

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

CS510 Operating System Foundations. Jonathan Walpole

File Management. Chapter 12

Disk Scheduling. Chapter 14 Based on the slides supporting the text and B.Ramamurthy s slides from Spring 2001

Chapter 14: File-System Implementation

COMP 530: Operating Systems File Systems: Fundamentals

Department of Computer Engineering University of California at Santa Cruz. File Systems. Hai Tao

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Chapter 14: Mass-Storage Systems. Disk Structure

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

Advanced File Systems. CS 140 Feb. 25, 2015 Ali Jose Mashtizadeh

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

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

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University

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

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

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

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

Chapter 10: Case Studies. So what happens in a real operating system?

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

Transcription:

CS 537 Fall 2017 Review Session Deadlock Conditions for deadlock: Hold and wait No preemption Circular wait Mutual exclusion QUESTION: Fix code List_insert(struct list * head, struc node * node List_move(struct list * list1, struct list * list2 { mutex_lock(&list1->lock); mutex_lock(&list2>lock); node * node = list1->head; list1->head = node->next; node->next = list2->head list2->head = node; mutex_unlock(&list2->lock); mutex_unlock(&list1->lock); } 1

Disks read/write head spindle platter sector surface cylinder track Disks Consider a disk with the following characteristics: Number of surfaces: 8 (= 2^3 ) Number of tracks / surface: 512 K (= 2^19) Number of bytes / track: 8 MB (= 2^23 bytes) Number of sectors / track: 8 K (= 2^13) Questions: How many heads does this disk have? What is the size of each sector? How many bytes per cylinder? What is the total capacity of this disk? 2

Disk Scheduling Types: FCFS SSTF / SPTF SCAN / C-SCAN Assume the disk head is at cylinder 18 and moving towards higher cylinders. Assume a stream of requests arrives for the following cylinders: 5, 20, 1, 60, 3, 8, 90, 2, 20, 40, 6, 70. With a FCFS scheduling policy, what is the total seek distance to service all the requests? a SSTF scheduling policy, what is the total seek distance? With a SCAN scheduling policy (bi-directional scanning), what is the total seek distance? SSDs Characteristics: - Fast random read - Erase blocks / page reads and writes - FTL for erase before write - In/place or Direct Mapping - Log structured Example question Given read speed of 50 microseconds, no parallelism, how many random reads per second? For a RAID-0 array with a random time of 2 miliseconds, how many disks needed for same performance If SSD can do 10 paralllel requests, how many disks? 3

RAID Raid types: 0, 1, 4, 5 Performance: sequential, random Reads, writes Sample: Different RAID levels have different performance. Given a RAID 10 or 01 (striping + mirroring) system and a RAID 5 (rotating parity) system using the same number of disks: Which provides better throughput (requests/second) (if either) for small reads (~1 KB)? Which provides better throughput for large writes (if either) (~1 MB) Why? File system API File names: Inode number Path name File handle Open / read and write / close Metadata accessed on open: Directory inode + directory data + file inode Metadata accessed on read/write File inode (may be cached) + file data File inode write optional to update modify time Metadata accessed on create: Directory inode/data File inode Inode bitmap Sample Question: How many blocks accessed to rename a file? 4

File system implementation Metadata approaches Contiguous Linked FAT Indexed / Multilevel index The standard Unix and FFS layout uses an inode with 10 direct pointers, 1 indirect pointer, 1 double indirect pointer, and 1 triple indirect pointer. Assume blocks are 1 KB, and block indexes are 4 bytes (32 bits). Starting with an empty file, how many blocks must be written to write to the 5 th block of the file? Please include all metadata updates. Starting with an empty file, how many blocks must be written to update the 270 th block of the file? FFS Cylinder groups Larger blocks + fragments Layout policy The Fast File System (FFS) tries to improve performance by grouping related things on disk in a cylinder group. List two file-system structures that FFS tries to place within a cylinder group Not everything can be near everything else. What things should FFS put in different cylinder groups and why? 5

LFS Segments Inode maps Cleaning Question: Describe one common file system operation that is sequential on LFS but requires seeks or rotations with FFS. Explain which structures in FFS are accessed as part of this operation. LFS uses segments to organize its log: the file system splits the disk into segments, and writes sequential within a segment before seeking to another segment. How should LFS decide how big to make a segment? Journaling & Recovery Redundancy FSCK Journaling Data journaling Ordered journaling Barriers & checksums Question: Suppose the disk you are using becomes faulty and a block on your disk becomes corrupted. For each of the following scenarios, say whether (a) what the impact of the failure is and (b) whether and how it could be repaired. You are storing free blocks as a linked list. Each free block has a pointer to the next free block. The first free block becomes corrupted, so you can no longer read the pointer it contains. You are storing files using linked allocation, so each block maintains a pointer to the next block in the file. One of the blocks in the middle of the file becomes corrupted. 6

Distributed Systems Differences with OS Dropped/lost messages Failures Protocols UDP TCP RPC Question: What technique protects against: Corrupted packets Dropped packets Duplicated packets NFS RPC messages for file system API File handles for recovery Caching + policy Update server on file close or after 30 seconds Poll for changes if haven t checked in 3 seconds Question: Client does open(), write(), write(). Server crashes & recovers between second and this write Another machine opens & read the file - what does it see? 7

Virtualization CPU virtualization: Trap + emulate Memory virtualization: Shadow + nested page tables I/O virtualization: Virtual devices Question What workloads perform equally well under virtualization? Which perform worse? 8