CSE 542: Operating Systems

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

More on File Management
Chapter 4 : File Systems What is a file system?
Chapter 10: File-System Interface
Chapter 11: File System Implementation
File System Implementation
File System Implementation
Memory Management (II)
Chapter 12: File System Implementation
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
Ceng Operating Systems
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
Chapter 12: File System Implementation
04/05/2004CSCI 315 Operating Systems Design1 File System Implementation.
File System Implementation
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
Dr. T. Doom 11.1 CEG 433/633 - Operating Systems I Chapter 11: File-System Implementation File structure –Logical storage unit –Collection of related information.
Free Space Management.
Silberschatz and Galvin  Operating System Concepts File-System Implementation File-System Structure Allocation Methods Free-Space Management.
Page 111/15/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  Allocation methods: Contiguous, Linked, Indexed,
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
File System Implementation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Module 4.0: File Systems File is a contiguous logical address space.
12.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 12: File System Implementation Chapter 12: File System Implementation.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
10.1 CSE Department MAITSandeep Tayal 10 :File-System Implementation File-System Structure Allocation Methods Free-Space Management Directory Implementation.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 11 File-System Implementation Slide 1 Chapter 11: File-System Implementation.
Page 112/7/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  File system structure – layered, block based.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Grades 1/10/2016CSE 60641: Operating Systems1. 10-Jan-16CSE 542: Operating Systems2 File system trace papers A trace-driven analysis of the UNIX 4.2 BSD.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Part III Storage Management
3.1 Advanced Operating Systems Superpages TLB coverage is the amount of memory mapped by TLB. I.e. the amount of memory that can be accessed without TLB.
W4118 Operating Systems Instructor: Junfeng Yang.
File-System Management
File System Implementation
Chapter 12: File System Implementation
Jonathan Walpole Computer Science Portland State University
File-System Implementation
Chapter 11: File System Implementation
FileSystems.
File System Implementation
Filesystems.
Review.
Chapter 12: File System Implementation
File Sharing Sharing of files on multi-user systems is desirable
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
Outline Allocation Free space management Memory mapped files
Introduction to Operating Systems
Overview: File system implementation (cont)
File-System Structure
Chapter 16 File Management
CSE 542: Operating Systems
Chapter 14: File-System Implementation
File system implementation
File System Implementation
CSE 542: Operating Systems
File System Interface (cont)
Presentation transcript:

CSE 542: Operating Systems Outline Practical, Transparent Operating System Support for Superpages Juan Navarro, Sitaram Iyer, Peter Druschel, and Alan Cox , In Fifth Symposium on Operating Systems Design and Implementation (OSDI 2002) Chapter 11: File System Interface Chapter 12: File System Implementation File System Trace Analysis This project started out as a OS course project and ended in SOSP!! Distributed File system trace analysis 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems Superpages Increasing cost in TLB miss overhead growing working sets TLB size does not grow at same pace Processors now provide superpages one TLB entry can map a large region OSs have been slow to harness them no transparent superpage support for apps 13-Jan-19 CSE 542: Operating Systems

TLB coverage as percentage of main memory TLB coverage trend TLB coverage as percentage of main memory Factor of 1000 decrease in 15 years TLB miss overhead: 5% 5-10% 30% 13-Jan-19 CSE 542: Operating Systems

Why multiple superpage sizes Improvements with only one superpage size vs. all sizes 64KB 512KB 4MB All FFT 1% 0% 55% galgel 28% 29% mcf 24% 31% 22% 68% 13-Jan-19 CSE 542: Operating Systems

Issue 1: superpage allocation virtual memory D A B C superpage boundaries A B C D physical memory B How / when / what size to allocate? 13-Jan-19 CSE 542: Operating Systems

Promotion: create a superpage out of a set of smaller pages Issue 2: promotion Promotion: create a superpage out of a set of smaller pages mark page table entry of each base page When to promote? Create small superpage? May waste overhead. Wait for app to touch pages? May lose opportunity to increase TLB coverage. Forcibly populate pages? May cause internal fragmentation. 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems Issue 3: demotion Demotion: convert a superpage into smaller pages when page attributes of base pages of a superpage become non-uniform during partial pageouts 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems Issue 4: fragmentation Memory becomes fragmented due to use of multiple page sizes persistence of file cache pages scattered wired (non-pageable) pages Contiguity: contended resource OS must use contiguity restoration techniques trade off impact of contiguity restoration against superpage benefits 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems File system interface File attributes Name: only information kept in human-readable form Type: Explicit or inferred Location: pointer to file location on device. Size: current file size Protection: controls who can do reading, writing, executing Time, date, user identification Operations: open, close, read, write, seek, append, delete, rename … Access: sequential, random, structured (indexed) Directory: Single, Two-level, Tree-structure, Acyclic Remote file systems: NFS, AFS, … 13-Jan-19 CSE 542: Operating Systems

Consistency Semantics UFS: Writes to open file are visible immediately to other users that have this file open at the same time AFS: Writes to an open file by a user are not visible immediately to other users that have the same file open simultaneously Semantics depend on the cost of providing consistency vs scalability 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems Protection Read, Write, Execute, Append, Delete, List etc using “owner, group, other” UNIX model or Access control lists (ACL) of NT, AFS -rw-rw---- 1 surendar mail 7384093 Sep 12 02:15 /var/mail/surendar ACL: Access list for . is Normal rights: system:administrators rlidwka system:anyuser l surendar rlidwka 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems File system structure 13-Jan-19 CSE 542: Operating Systems

File system implementation Virtual File Systems - easily change underlying storage mechanisms to local or remote Directory Implementation: Linear list, Hash table Allocation: Contiguous (fragmentation), linked allocation (FAT), Indexed Allocation (single level, multilevel) Free space management: Bit vector, Linked list, Grouping, Counting Recovery and consistency checking 13-Jan-19 CSE 542: Operating Systems

Contiguous allocation 13-Jan-19 CSE 542: Operating Systems

File allocation table (FAT) 13-Jan-19 CSE 542: Operating Systems

Unix - Indexed allocation 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems Backups Backup and restore: Towers of Hanoi style levels Full+Incremental backups Level 0 - full level n takes all changes since last, lower numbered level E.g. 0, 5, 6, 3, 5, 6 Full, 5-0, 6-5, 3-0, 5-3, 6-5 Log structured file system Provide transactional guarantees for critical meta-data Pathname translation: Multilevel directories in order from the root Caching to improve performance /usr/local/bin/ls would be /, /usr, /usr/local, /usr/local/bin .. 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems LFS Log structured (or journaling) file systems record each update to the file system as a transaction. All transactions are written to a log. A transaction is considered committed once it is written to the log. However, the file system may not yet be updated. The transactions in the log are asynchronously written to the file system. When the file system is modified, the transaction is removed from the log. If the file system crashes, all remaining transactions in the log must still be performed. 13-Jan-19 CSE 542: Operating Systems

Trace driven analysis of the UNIX file system Rather old, but seminal. Influenced much of file system design for a long time Studies like these are extremely important to understand how typical users are using a file system so that you can tune for performance 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems The key is to trace the “typical user population”. Academics do not have access to commercial work loads Chicken and Egg syndrome: Users perform certain tasks because current systems perform poorly. E.g. users may backup their work into a separate file every so often because of poor consistency guarantees. UNIX vi editor saves files by deleting old file, creating a new file with the same name, writing all the data and then closing. If the system crashes after creating and write, before close, data is left in buffers which are lost, leading to a 0 byte file. It happened a lot and so programs create backup files often. 13-Jan-19 CSE 542: Operating Systems

Important conclusions Most files are small; whole file transfer and open for short intervals. Most files are short lived. Caching really works. UNIX used files as intermediate data transfer mechanisms: E.g. compiler Preprocessor reads .c file -> .i file CC1 reads .i -> .asm file and deletes .i file Assembler reads .asm -> .o file and deletes .asm file Linker reads .o -> executable and deletes .o file One solution: Make /tmp an in-memory file system df /tmp Filesystem 1k-blocks Used Available Use% Mounted on swap 1274544 1776 1272768 1% /tmp 13-Jan-19 CSE 542: Operating Systems

Most files are read sequentially UNIX provides no support for structured files Applications that provide structured access (data bases) use raw file interface and by-pass operating systems Solution: Read-ahead to improve performance 13-Jan-19 CSE 542: Operating Systems

Most file accesses are to the same directory UNIX has a hierarchical file system structure Typical academic users compile, word process from one directory and so all accesses are to a single directory File systems such as Coda, AFS have notions of volumes, cells that capture this Does this apply to Windows? 13-Jan-19 CSE 542: Operating Systems

CSE 542: Operating Systems Most files are small On a departmental machine with 8 MB of main memory, what else do you expect Is it true now with our Netscape, xemacs, IE, Power point etc? Relatively, it may still be true. On a 60 GB hard disk, 1 MB file may be “small” 13-Jan-19 CSE 542: Operating Systems