Design IV Chapter 18 11/14/2018 Crowley OS Chap. 18.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Paging Hardware With TLB
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Input-output and Communication Prof. Sin-Min Lee Department of Computer Science.
File System Implementation
Recap. The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of the.
1 What is a Process ? The activity of program execution. Also called a task or job Has associated with it: Code Data Resources A State An executing set.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Chapter 3.7 Memory and I/O Systems. 2 Memory Management Only applies to languages with explicit memory management (C or C++) Memory problems are one of.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
hardware and operating systems basics.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Chapter 8 Memory Management Dr. Yingwu Zhu. Outline Background Basic Concepts Memory Allocation.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Operating Systems: Summary INF1060: Introduction to Operating Systems and Data Communication.
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
Introduction to Operating Systems Concepts
Translation Lookaside Buffer
Non Contiguous Memory Allocation
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 8: Main Memory.
Chapter 12: File System Implementation
Avani R.Vasant V.V.P. Engineering College
Day 21 Virtual Memory.
File System Implementation
Day 22 Virtual Memory.
Operating Systems (CS 340 D)
Design III Chapter 13 9/20/2018 Crowley OS Chap. 13.
I/O Devices Chapter 14 9/20/2018 Crowley OS Chap. 14.
Resource Management Chapter 19 9/20/2018 Crowley OS Chap. 19.
Design Techniques II Chapter 9 9/20/2018 Crowley OS Chap. 9.
Paging and Segmentation
I/O Systems Chapter 15 11/7/2018 Crowley OS Chap. 15.
Chapter 8: Main Memory.
The Hardware Interface
Naming and Directories
OS Virtualization.
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Naming and Directories
Evolution in Memory Management Techniques
Naming and Directories
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture 3: Main Memory.
Virtual Memory Overcoming main memory size limitation
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Contents Memory types & memory hierarchy Virtual memory (VM)
Chapter 8: Memory Management strategies
Improving IPC by Kernel Design
Chapter 15: File System Internals
Processes in Unix, Linux, and Windows
CSE 471 Autumn 1998 Virtual memory
CSE 542: Operating Systems
Chapter 2: Operating-System Structures
Department of Computer Science
Naming and Directories
Design Techniques II Chapter 9 6/25/2019 Crowley OS Chap. 9.
Mr. M. D. Jamadar Assistant Professor
CSE 542: Operating Systems
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Page Main Memory.
Presentation transcript:

Design IV Chapter 18 11/14/2018 Crowley OS Chap. 18

Key concepts in chapter 18 Caching Hinting Hierarchical naming systems Naming Unification of concepts 11/14/2018 Crowley OS Chap. 18

Design technique: Caching Caching: speed up a slow operation by remembering the result of previous invocations of the operation Useful whenever the operation is often called with the same arguments Can radically speed up the average operation time but it uses space to hold old answers and depends on “locality” of operation arguments 11/14/2018 Crowley OS Chap. 18

Generalized caching 11/14/2018 Crowley OS Chap. 18

OS examples of caching Virtual memory TLB File descriptor table Disk block cache Pathname lookup cache 11/14/2018 Crowley OS Chap. 18

CS examples of caching Hardware caching Memoizing a function in memory systems in processors: modern processors have several caches Memoizing a function a general Lisp and Scheme technique for speeding up a function 11/14/2018 Crowley OS Chap. 18

Caching issues Dynamic programming: a form of caching Minimal hashing: often saving one or two answers will get most of the speedup Cache invalidation: we need to know when the answers become invalid sometimes this is difficult Hooks: register procedures to be called when something changes an ideal way to keep caches valid 11/14/2018 Crowley OS Chap. 18

Optimizing We can: Remembering previous results speed up every instance of an operation e.g. faster hardware, better algorithm speed up some instances of the operation e.g. caching Remembering previous results caching: remembered results are always correct assuming we do cache invalidation correctly hinting: remembered results are often correct and we have a fast way to check their correctness 11/14/2018 Crowley OS Chap. 18

Hinting examples Remember the machine that a network service was on the last time you used it if it has moved your request will return an error Remember the last location and size of a user window if they want it changed they can do it 11/14/2018 Crowley OS Chap. 18

Hierarchical names A name space is a collection of names where each name is mapped to an object The object mapped to can be another name space which allows general graphs of name spaces the most interesting special case is when the name space form a tree this is a hierarchical naming system, like file system names where each directory is a name space 11/14/2018 Crowley OS Chap. 18

Name space 11/14/2018 Crowley OS Chap. 18

A hierarchy of name spaces 11/14/2018 Crowley OS Chap. 18

Address name space hierarchy 11/14/2018 Crowley OS Chap. 18

Hierarchical naming examples File path names: /u1/crowley/book/ch16 IP addresses: 230.45.67.7 Internet domain addresses: www.unm.edu Programming language names: owner.name 11/14/2018 Crowley OS Chap. 18

Naming issues Flat name space: all names are unique, there is no hierarchy Generating unique name (two methods) a central authority checks proposed names for uniqueness a central authority generates unique names Adjoining name spaces another way to combine name spaces search the name space, in order, for a name 11/14/2018 Crowley OS Chap. 18

Generating unique names 11/14/2018 Crowley OS Chap. 18

Adjoining name maps 11/14/2018 Crowley OS Chap. 18

Creating a unique name // generate a unique file name char * name = "tempaaaa”; char * end = &name[7]; while( 1 ) { // Does the file exist? if( access(name,F_OK) != 0 ) break; // No, it is unique. while( 1 ) { if( *end < 'z' ) { ++(*end); } else { *end = 'a'; --end; // try the next position to the left } } } // "name" does not exist fid = creat( name, MODE ); 11/14/2018 Crowley OS Chap. 18

Creating a unique name safely // generate a unique file name char * name = "tempaaaa”; while( 1 ) { fid = open( name, O_CREAT | O_EXCL, MODE ); if( fid >= 0 ) break; char * end = &name[7]; while( 1 ) { if( *end < 'z' ) { ++(*end); break; else { *end = 'a'; --end; // try the next position to the left } } } // file with unique file name "name" has been created 11/14/2018 Crowley OS Chap. 18

Design technique: Unification of concepts Simplify a system by combining two concepts that are similar the resulting system is simpler Example: combine the device and file name spaces and unify the interface to devices and files 11/14/2018 Crowley OS Chap. 18

Examples of unifying concepts OS examples unifying the file and device access interfaces the device driver interface unifies device access pipes unify file access and IPC mapped files unify virtual memory and I/O CS examples procedures unify common code sections super classes unify two child classes this is a basic theme of object-oriented programming 11/14/2018 Crowley OS Chap. 18