1 Virtual Memory COMP375 Computer Architecture and Organization
2 You never know when you're making a memory. Rickie Lee Jones
3 Design Project The project is due 1:00pm (start of class) on Monday, October 19, 2015 (Now) Be sure to include the names of both team members
4 Exam on Wednesday The second exam in COMP375 will be on Friday, October 23, 2015 It covers all the material since the first exam Interrupts Busses Memory VLSI Cache Virtual Memory You may have one 8½ by 11" page of notes
5 Goals for Memory Management Have the programs in memory when they need to run Convert program addresses to physical addresses. Protect one program from another Allow programs to share data and instructions Support read-only or execute-only segments
6 Sub Goals Fast address translation Simple for the OS to allocate and release memory. Minimize fragmentation This is an example of a bin packing problem and is NP-complete even if you have all of the memory requests at one time.
7 Program to Physical Everybody s program is compiled and linked with the first byte of the program at address zero. Since many programs are run simultaneously on the computer, each cannot be loaded starting at physical address zero. The hardware converts each memory reference from a program address to a hardware physical address.
8 Physical Mapping Schemes Base Address Paged Memory Virtual Memory Segmented addresses Flat single address scheme
9 Base Address Programs are located in any convenient contiguous part of memory. When a program is to execute, the base register is loaded with the start address of the program. The program effective address from each memory reference is added to the value in the base register to create the physical memory location.
10 Base Address Translation Base Address Register Program address 123 is located in RAM at the real physical address
11 Limit Register The limit register contains the highest address of the program. The memory system checks each memory reference to make sure it is not greater than the value in the limit register. An addressing exception interrupt occurs if the address is too large.
12 Base Address with Limits Limit Register Base Address Register Program address is too large
13 Fragmentation As memory is allocated and released, the usable areas become fragmented. Internal fragmentation occurs when a program is allocated to a memory area that is bigger than needed. The leftover is lost due to internal fragmentation. External fragmentation occurs when there are many small unallocated areas. These areas are hard to use because they are small and divided.
14 Fragmented Memory In this memory diagram two programs use 5 MB of the 8 MB in the system. There is 3 MB available. A 2 MB program cannot be put in memory because the available space is fragmented. 1 M 2 M 1 M 3M 1 M
15 If you allocate memory in 1K blocks, what is the maximum internal fragmentation per program? 1. 4 GB 2. 1 KB bytes bytes
16 Evaluation of Base Register Convert program addresses to physical addresses. Simple and efficient Make it easy for the operating system to place the program in memory. Programs have to be located in contiguous memory. It can be a challenge to fit the programs into the available space.
17 Evaluation of Base Register Allow sharing of data and instructions Each program is separate. No sharing Detect out of range memory accesses. Simple and efficient Provide read-only and no-execute memory segments. All of memory is treated the same.
18 Using the Base Register Method Some ancient OS set the base register to certain fixed addresses to create fixed sized areas for programs. This was not very effective. Better OS put the programs wherever they would fit and set the base register to the beginning of the program.
19 Paged Memory RAM and programs are divided into fixed sized pages. The page size is usually fixed for a given architecture, often between 512-8K bytes The pages of a program can be put anywhere in RAM. They do not have to be contiguous. The page table keeps track of the physical location of pages. The page table is indexed by the page number portion of a program address.
20 Pages in RAM Page Table C 7 RAM 0 1 / / 2 4 / / A B C / 3 D E F
21 Virtual to Physical Address The upper bits of a program address are used as an index into a page table. Each page table entry contains the physical address for that page of the program. The lower bits of the program address (which indicate which byte in the page is desired) are concatenated to the end of the physical page address.
22 Address Translation
23 Example with 4K pages 3 C90 Virtual Address 0 372A 1 06E AB6 1662C90 Physical Address
24 Dividing the Address The offset portion of the address is always the lower log 2 ( size of a page) bits of the address. The page number portion are all of the address bits that are not part of the offset.
25 Fragmentation When using paging, programs can be loaded into RAM without worrying about fragmenting memory into small pieces. There is no external fragmentation. If the program size is not an even multiple of the page size, the last page will only be partially filled. This is internal fragmentation With large memories this is unimportant. Paging makes much better use of RAM.
26 How many bits are used for the page number and offset? Assume 1 GB address space and 2K byte pages. 1. page# = 21 offset = page# = 22 offset = page# = 19 offset = page# = 20 offset = 12
27 Big Programs Even when using every byte of RAM, it is not always possible to load all the programs users would like. Frequently large parts of programs are never executed. There are many features of Microsoft Word you have never used. More programs could fit in memory if only the used portions were loaded into RAM.
28 Virtual Memory Virtual Memory is an extension of paging. Only the pages that are being used are in RAM. A copy of all pages of a program are on the page file. If a program accesses an address in a page not in RAM, the hardware creates a page fault interrupt and the OS copies the desired page into RAM.
29 Virtual Memory Implementation Unused pages of a program do not need to be in RAM to execute the program. A resident bit is added to the page table. Pages in RAM have the resident bit set. Pages not in RAM have the resident bit cleared. All pages are stored on disk. When a program references a page with the resident bit clear, the hardware creates a page fault interrupt.
30 Address Translation
31 Only Necessary Pages in RAM Program addresses showing pages that are referenced Page Table 0->D 1 2->6 3->A >5 7 RAM
32 Hardware and Operating System Virtual memory requires both hardware and operating system support. When a page fault interrupt occurs, the OS reads the desired page from disk into an available page of RAM. The user s page table is updated to point to the newly loaded page. The program is placed back on the ready list to be executed.
33 User Programs and Virtual Memory Virtual memory is transparent to user programs. Programs are unaware of page faults. The only impact of virtual memory on user programs is performance. If a program creates frequent page faults, the program will run very slowly.
34 Page Table Flags Each page table entry has flag bits Resident set if the virtual address is in RAM and clear otherwise. Used set when the page is referenced. Dirty set when the page is changed. No Execute Instructions cannot be fetched from this page. The Used and Dirty bits are set by the hardware and cleared by the OS.
35 Locality of Reference Temporal locality - a referenced location is likely to be referenced again. Spatial locality - nearby locations are likely to be referenced soon.
36 Memory Hierarchy Virtual Memory Caching
37 Address Translation
38 Translation Lookaside Buffer The Translation Lookaside Buffer (TLB) is a special cache to hold recently used page table entries. The CPU looks in the TLB for a page entry before looking in the page table. Without the TLB each memory reference would require two memory accesses. Most TLBs are small and use fully associative mapping.
39 Performance Factors The hardware handles the normal address translation. When a page fault occurs, the OS determines where the page will be loaded and what page will be overwritten. The OS must minimize the number of page faults. The OS determines which and how many pages of a program are in RAM.
40 Virtual Memory Performance Computers can retrieve a word from RAM in about 60 ns (6 x 10-8 sec) A good disk drive can read a block of data in about 6 ms (6 x 10-3 sec) If the needed page is not in RAM and has to be read from the disk, it takes about 100,000 times longer to get the data. Page fault interrupts have to be kept to a minimum.
41 A High Hit Rate Is Important Consider RAM in access in 60 ns and disk drive access in 6 ms. If the hit ratio is 99.99% avg access = * 6 x 10-8 sec * 6 x 10-3 sec = 660 nsec The average memory access time is about 11 times slower.
42 What is the average access time for 99.9% hit rate with 9.0 ms disk and 9.0 ns memory? ms ns ms μs ns
43 Program to Physical Translation Goals Convert program addresses to physical addresses. More complicated than base address. May require two memory accesses. Make it easy for the operating system to place the program in memory. Much easier than base address Allow sharing of data and instructions Pages can be shared between programs
44 Program to Physical Translation Goals Detect out of range memory accesses. If the page table index is too large, a segmentation fault interrupt with occur. Provide read-only and no-execute memory segments. Different pages can be marked read-only or no-execute
45 Virtual Memory Advantages Allows you to fit many large programs into a relatively small RAM. Only part of a program needs to be loaded into memory. Eliminates the need to fit programs into memory holes.
46 Virtual Memory Disadvantages 1. Makes address translation much more complicated 2. Can reduce performance 3. Makes program execution time less predictable 4. All of the above 5. None of the above
47 Segmented Memory Memory can be separated into segments based on the program. instruction segments for each function data segments for global data and heap stack segments Segmentation provides greater function isolation and makes linking easier. Segments can have virtual memory pages
48 Program Memory Organization Heap Stack Global data Program instructions
51 Exam on Wednesday The second exam in COMP375 will be on Friday, October 23, 2015 It covers all the material since the first exam Interrupts Busses Memory VLSI Cache Virtual Memory You may have one 8½ by 11" page of notes
COS 318: Operating Systems Virtual Memory and Address Translation Today s Topics Midterm Results Virtual Memory Virtualization Protection Address Translation Base and bound Segmentation Paging Translation
Lecture 17: Virtual Memory II Last Lecture: Introduction to virtual memory Today Review and continue virtual memory discussion Lecture 17 1 Goals of virtual memory Make it appear as if each process has:
How is it possible for each process to have contiguous addresses and so many of them? Computer Systems Organization (Spring ) CSCI-UA, Section Instructor: Joanna Klukowska Teaching Assistants: Paige Connelly
Computer Architecture Slide Sets WS 2013/2014 Prof. Dr. Uwe Brinkschulte M.Sc. Benjamin Betting Part 11 Memory Management Computer Architecture Part 11 page 1 of 44 Prof. Dr. Uwe Brinkschulte, M.Sc. Benjamin
COMPUTER HARDWARE Input- Output and Communication Memory Systems Computer I/O I/O devices commonly found in Computer systems Keyboards Displays Printers Magnetic Drives Compact disk read only memory (CD-ROM)
OPERATING SYSTEMS MEMORY MANAGEMENT Jerry Breecher 8: Memory Management 1 OPERATING SYSTEM Memory Management What Is In This Chapter? Just as processes share the CPU, they also share physical memory. This
The Deadlock Problem Deadlocks A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 tape drives. P 1 and P 2 each
1 / 36 The Problem Application Data? Filesystem Logical Drive Physical Drive 2 / 36 Requirements There are different classes of requirements: Data Independence application is shielded from physical storage
The Quest for Speed - Memory Cache Memory CSE 4, Spring 25 Computer Systems http://www.cs.washington.edu/4 If all memory accesses (IF/lw/sw) accessed main memory, programs would run 20 times slower And
Hierarchy Arturo Díaz D PérezP Centro de Investigación n y de Estudios Avanzados del IPN email@example.com Hierarchy- 1 The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor
Operating Systems CSE 410, Spring 2004 File Management Stephen Wagner Michigan State University File Management File management system has traditionally been considered part of the operating system. Applications
COMP 242 Class Notes Section 6: File Management 1 File Management We shall now examine how an operating system provides file management. We shall define a file to be a collection of permanent data with
12 Paging: Introduction Remember our goal: to virtualize memory. Segmentation (a generalization of dynamic relocation) helped us do this, but has some problems; in particular, managing free space becomes
Data Storage - I: Memory Hierarchies & Disks W7-C, Spring 2005 Updated by M. Naci Akkøk, 27.02.2004 and 23.02.2005, based upon slides by Pål Halvorsen, 11.3.2002. Contains slides from: Hector Garcia-Molina,
Logistics Week 1: Wednesday, Jan 27 Because of overcrowding, we will be changing to a new room on Monday (Snee 1120). Accounts on the class cluster (crocus.csuglab.cornell.edu) will be available next week.
Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how
Addendum Intel Architecture Software Developer s Manual Volume 3: System Programming Guide Order Number: 243690-001 NOTE: The Intel Architecture Software Developer s Manual consists of the following volumes:
SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications Jürgen Primsch, SAP AG July 2011 Why In-Memory? Information at the Speed of Thought Imagine access to business data,
technology brief RAID Levels March 1997 Introduction RAID is an acronym for Redundant Array of Independent Disks (originally Redundant Array of Inexpensive Disks) coined in a 1987 University of California
KVM & Memory Management Updates KVM Forum 2012 Rik van Riel Red Hat, Inc. KVM & Memory Management Updates EPT Accessed & Dirty Bits 1GB hugepages Balloon vs. Transparent Huge Pages Automatic NUMA Placement
Dynamics NAV/SQL Server Configuration Recommendations This document describes SQL Server configuration recommendations that were gathered from field experience with Microsoft Dynamics NAV and SQL Server.
Physical Data Organization Database design using logical model of the database - appropriate level for users to focus on - user independence from implementation details Performance - other major factor
Lecture 21: Storage Administration Take QUIZ 15 over P&H 6.1-4, 6.8-9 before 11:59pm today Project: Cache Simulator, Due April 29, 2010 NEW OFFICE HOUR TIME: Tuesday 1-2, McKinley Last Time Exam discussion
Main Memory & Backing Store Main memory backing storage devices 1 Introduction computers store programs & data in two different ways: nmain memory ntemporarily stores programs & data that are being processed
Architecture of Hitachi SR-8000 University of Stuttgart High-Performance Computing-Center Stuttgart (HLRS) www.hlrs.de Slide 1 Most of the slides from Hitachi Slide 2 the problem modern computer are data
Presentation of Diagnosing performance overheads in the Xen virtual machine environment September 26, 2005 Framework Using to fix the Network Anomaly Xen Network Performance Test Using Outline 1 Introduction
18 Paging: Introduction It is sometimes said that the operating system takes one of two approaches when solving most any space-management problem. The first approach is to chop things up into variable-sized
Lecture 7: Storage Management File System Management Contents Non volatile memory Tape, HDD, SSD Files & File System Interface Directories & their Organization File System Implementation Disk Space Allocation
Database Fundamentals Computer Science 105 Boston University David G. Sullivan, Ph.D. Bit = 0 or 1 Measuring Data: Bits and Bytes One byte is 8 bits. example: 01101100 Other common units: name approximate
Virtual Machines Uses for Virtual Machines Virtual machine technology, often just called virtualization, makes one computer behave as several computers by sharing the resources of a single computer between
DATABASE Pervasive PSQL Performance Key Performance Features of Pervasive PSQL Pervasive PSQL White Paper June 2008 Table of Contents Introduction... 3 Per f o r m a n c e Ba s i c s: Mo r e Me m o r y,
The Reduced Address Space (RAS) for Application Memory Authentication David Champagne, Reouven Elbaz and Ruby B. Lee Princeton University, USA Introduction Background: TPM, XOM, AEGIS, SP, SecureBlue want
EZManage V4.0 Release Notes Document revision 1.08 (15.12.2013) Release Features Feature #1- New UI New User Interface for every form including the ribbon controls that are similar to the Microsoft office
Chapter 1 Storage Devices Summary Dependability is vital Suitable measures Latency how long to the first bit arrives Bandwidth/throughput how fast does stuff come through after the latency period Obvious
Microsoft Office Outlook 2013: Part 1 Course Specifications Course Length: 1 day Overview: Email has become one of the most widely used methods of communication, whether for personal or business communications.
W4118 Operating Systems Instructor: Junfeng Yang Outline x86 segmentation and paging hardware Linux address space translation Copy-on-write Linux page replacement algorithm Linux dynamic memory allocation
Computer Systems Structure Main Memory Organization Peripherals Computer Central Processing Unit Main Memory Computer Systems Interconnection Communication lines Input Output Ward 1 Ward 2 Storage/Memory
Sawmill Log Analyzer Best Practices!! Page 1 of 6 Sawmill Log Analyzer Best Practices! Sawmill Log Analyzer Best Practices!! Page 2 of 6 This document describes best practices for the Sawmill universal
Hypervisor: Requirement Document (Version 3) Jean-Raymond Abrial and Rustan Leino No Institute Given 1 Requirement Document 1.1 A single system memory handling - SM-0: An operating system (OS) makes use
Microsoft Dynamics NAV 2013 R2 Sizing Guidelines for On-Premises Single Tenant Deployments July 2014 White Paper Page 1 Contents 3 Sizing Recommendations Summary 3 Workloads used in the tests 3 Transactional
HY345 Operating Systems Recitation 2 - Memory Management Solutions Panagiotis Papadopoulos firstname.lastname@example.org Problem 7 Consider the following C program: int X[N]; int step = M; //M is some predefined constant
Slide Set 8 for ENCM 369 Winter 2015 Lecture Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 2015 ENCM 369 W15 Section
Overview Concepts of Mobile Operating Systems Lecture 11 Concepts of Mobile Operating Systems Mobile Business I (WS 2007/08) Prof Dr Kai Rannenberg Chair of Mobile Business and Multilateral Security Johann
Fastboot Techniques for x86 Architectures Marcus Bortel Field Application Engineer QNX Software Systems Agenda Introduction BIOS and BIOS boot time Fastboot versus BIOS? Fastboot time Customizing the boot
A Deduplication File System & Course Review Kai Li 12/13/12 Topics A Deduplication File System Review 12/13/12 2 Traditional Data Center Storage Hierarchy Clients Network Server SAN Storage Remote mirror
Using Synology SSD Technology to Enhance System Performance Synology Inc. Synology_WP_ 20121112 Table of Contents Chapter 1: Enterprise Challenges and SSD Cache as Solution Enterprise Challenges... 3 SSD
COS 318: Operating Systems File Performance and Reliability Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Topics File buffer cache
This is the first blog post in a series I'll write over the coming months called Pushing the Limits of Windows that describes how Windows and applications use a particular resource, the licensing and implementation-derived
File Systems Management and Examples Today! Efficiency, performance, recovery! Examples Next! Distributed systems Disk space management! Once decided to store a file as sequence of blocks What s the size
TheraDoc v4.6.1 Hardware and Software Requirements In preparation for the release of TheraDoc v4.6.1, we have the following important information to communicate. Client Workstation Browser Requirements
MS Exchange Server Backup - User Guide TABLE OF CONTENTS Introduction...2 Features...2 System Requirements...4 Exchange Server 2010... 4 Exchange Server 2007... 4 Exchange Server 2003... 4 Exchange Server
Putting it all together: Intel Nehalem http://www.realworldtech.com/page.cfm?articleid=rwt040208182719 Intel Nehalem Review entire term by looking at most recent microprocessor from Intel Nehalem is code
Autodesk AutoCAD Map 3D 2009 Citrix XenApp 4.5 Performance Analysis Notice The information in this publication is subject to change without notice. THIS PUBLICATION IS PROVIDED AS IS WITHOUT WARRANTIES
Patentamt JEuropaisches European Patent Office Publication number: 0 113 240 Office europeen des brevets A2 EUROPEAN PATENT APPLICATION Application number: 83307846.2 Int. CI.3: G 1 1 C 9/06 w G 06 F 13/00
Big-data Analytics: Challenges and Opportunities Chih-Jen Lin Department of Computer Science National Taiwan University Talk at 台 灣 資 料 科 學 愛 好 者 年 會, August 30, 2014 Chih-Jen Lin (National Taiwan Univ.)
Binary search tree with SIMD bandwidth optimization using SSE Bowen Zhang, Xinwei Li 1.ABSTRACT In-memory tree structured index search is a fundamental database operation. Modern processors provide tremendous
X3T10 95-321 Rev 1 PC Boot Considerations for Devices >8GB Overview This is a draft of a document proposed in the System Issues Study Group meeting held on 7/12/95 in Colorado Springs. It is intended to
Intel NAS Performance Toolkit Anthony Bock Frank Hady Storage Technology Group, Intel Corporation Agenda Home/SMB Performance NAS Performance Toolkit Introduction Consumer NAS Performance Overview Using
CS 6290 I/O and Storage Milos Prvulovic Storage Systems I/O performance (bandwidth, latency) Bandwidth improving, but not as fast as CPU Latency improving very slowly Consequently, by Amdahl s Law: fraction
External Sorting Chapter 13 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Why Sort? A classic problem in computer science! Data requested in sorted order e.g., find students in increasing
Implementation of Buffer Cache Simulator for Hybrid Main Memory and Flash Memory Storages Soohyun Yang and Yeonseung Ryu Department of Computer Engineering, Myongji University Yongin, Gyeonggi-do, Korea
White Paper Joshua Ruggiero Computer Systems Engineer Intel Corporation Measuring Cache and Memory Latency and CPU to Memory Bandwidth For use with Intel Architecture December 2008 1 321074 Executive Summary
Speeding Up Cloud/Server Applications Using Flash Memory Sudipta Sengupta Microsoft Research, Redmond, WA, USA Contains work that is joint with B. Debnath (Univ. of Minnesota) and J. Li (Microsoft Research,
theguard! Service Management Center (Valid for Version 6.3 and higher) Introduction Introduction about the minimal system requirements of theguard! Service Management Center. The theguard! Service Management
High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++ Daniel Adler, Jens Oelschlägel, Oleg Nenadic, Walter Zucchini Georg-August University Göttingen, Germany - Research
PBLCACHE A client side persistent block cache for the data center Vault Boston 2015 - Luis Pabón - Red Hat ABOUT ME LUIS PABÓN Principal Software Engineer, Red Hat Storage IRC, GitHub: lpabon QUESTIONS:
Hardware and Requirements for Installing California.pro This document lists the hardware and software requirements to install and run California.pro. Workstation with SQL Server type: Pentium IV-compatible
Overview What is so cool about the SQL diagnostic manager Management Pack? The SQL diagnostic manager (SQLdm) Management Pack integrates key monitors and alerts used by SQL Server DBAs with Microsoft's
NAS 249 Virtual Machine Configuration with VirtualBox Configure and run Virtual Machines on ASUSTOR Portal with VirtualBox A S U S T O R C O L L E G E COURSE OBJECTIVES Upon completion of this course you
In and Out of the PostgreSQL Shared Buffer Cache 2ndQuadrant US 05/21/2010 About this presentation The master source for these slides is http://projects.2ndquadrant.com You can also find a machine-usable
Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ 2008, Prentice Hall I/O Devices Roadmap Organization
ADVANTAGES OF RUNNING ORACLE11G ON MICROSOFT WINDOWS SERVER X64 Edward Whalen, Performance Tuning Corporation INTRODUCTION Microsoft Windows has long been an ideal platform for the Oracle database server.
DELL RAID PRIMER DELL PERC RAID CONTROLLERS Joe H. Trickey III Dell Storage RAID Product Marketing John Seward Dell Storage RAID Engineering http://www.dell.com/content/topics/topic.aspx/global/products/pvaul/top
Operating Systems: Internals and Design Principles Chapter 14 Virtual Machines Eighth Edition By William Stallings Virtual Machines (VM) Virtualization technology enables a single PC or server to simultaneously
Storage in Database Systems CMPSCI 445 Fall 2010 1 Storage Topics Architecture and Overview Disks Buffer management Files of records 2 DBMS Architecture Query Parser Query Rewriter Query Optimizer Query
January 26, 2014 This is a publication of Abila, Inc. Version 2014.x 2013 Abila, Inc. and its affiliated entities. All rights reserved. Abila, the Abila logos, and the Abila product and service names mentioned
Tech Tip: Understanding Server Memory Counters Written by Bill Bach, President of Goldstar Software Inc. This tech tip is the second in a series of tips designed to help you understand the way that your
Minimum Hardware Configurations for EMC Documentum Archive Services for SAP Practical Sizing Guide Abstract The sizing of hardware in a deployment of EMC Document Archive Services for SAP is determined
Google File System Web and scalability The web: - How big is the Web right now? No one knows. - Number of pages that are crawled: o 100,000 pages in 1994 o 8 million pages in 2005 - Crawlable pages might
Operating Systems: Internals and Design Principles Chapter 12 File Management Eighth Edition By William Stallings Files Data collections created by users The File System is one of the most important parts
Full and Para Virtualization Dr. Sanjay P. Ahuja, Ph.D. 2010-14 FIS Distinguished Professor of Computer Science School of Computing, UNF x86 Hardware Virtualization The x86 architecture offers four levels
Milestone Systems White Paper Storage Architecture in XProtect Corporate Prepared by: John Rasmussen Product Manager XProtect Corporate Milestone Systems Date: 7 February, 2011 Page 1 of 20 Table of Contents