Virtual Memory and Address Translation



Similar documents
CSE 231 Fall 2015 Computer Project #4

Lecture 17: Virtual Memory II. Goals of virtual memory

Microsoft SQL Server Administration

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs

A Beginner s Guide to Building Virtual Web Servers

learndirect Test Information Guide The National Test in Adult Numeracy

Caching Software Performance Test: Microsoft SQL Server Acceleration with FlashSoft Software 3.8 for Windows Server

Backups and Backup Strategies

Deployment Overview (Installation):

Hardware components. Typical connections and data flow. Student 3 page 1: Low Merit

Implementing ifolder Server in the DMZ with ifolder Data inside the Firewall

Customers FAQs for Webroot SecureAnywhere Identity Shield

Ten Steps for an Easy Install of the eg Enterprise Suite

COS 318: Operating Systems. Virtual Memory and Address Translation

Service Desk Self Service Overview

Exercise 5 Server Configuration, Web and FTP Instructions and preparatory questions Administration of Computer Systems, Fall 2008

FAQs for Webroot SecureAnywhere Identity Shield

Using Identity Finder. ITS Training Document

Licensing Windows Server 2012 for use with virtualization technologies

Data Warehouse Scope Recommendations

BASIC TECHNICAL FEATURE DESCRIPTION

Setup PPD IT How-to Guides June 2010

CREDIT REPORTING USER GUIDE

OUTLOOK All About Archives

Exercise 5 Server Configuration, Web and FTP Instructions and preparatory questions Administration of Computer Systems, Fall 2008

How do I evaluate the quality of my wireless connection?

STIOffice Integration Installation, FAQ and Troubleshooting

Virtual vs Physical Addresses

BRILL s Editorial Manager (EM) Manual for Authors Table of Contents

Your Outlook Mailbox can be accessed from any PC that is connected to the Internet.

What's New. Sitecore CMS 6.6 & DMS 6.6. A quick guide to the new features in Sitecore 6.6. Sitecore CMS 6.6 & DMS 6.6 What's New Rev:

Anatomy of Informz Templates. Understanding Standard and Advanced Templates

Responsive Design Fundamentals Chapter 1: Chapter 2: name content

Disk Redundancy (RAID)

What Happens To My Benefits If I Get a Bunch of Money? TANF Here is what happens if you are on the TANF program when you get lump-sum income:

PENNSYLVANIA SURPLUS LINES ASSOCIATION Electronic Filing System (EFS) Frequently Asked Questions and Answers

Improved Data Center Power Consumption and Streamlining Management in Windows Server 2008 R2 with SP1

Custom Portlets. an unbiased review of the greatest Practice CS feature ever. Andrew V. Gamet

Access to the Ashworth College Online Library service is free and provided upon enrollment. To access ProQuest:

Frequently Asked Questions November 19, Which browsers are compatible with the Global Patent Search Network (GPSN)?

Tipsheet: Sending Out Mass s in ApplyYourself

Business Intelligence represents a fundamental shift in the purpose, objective and use of information

The Design of a Flash-based Linux Swap System. Yeonseung Ryu Myongji University October, 2008

1 GETTING STARTED. 5/7/2008 Chapter 1

CLIENT PORTAL GUIDE SUMMARY

Citizen Service Management

FOCUS Service Management Software Version 8.5 for Passport Business Solutions Installation Instructions

WatchDox Outlook Plug-In: Quick Start Guide

990 e-postcard FAQ. Is there a charge to file form 990-N (e-postcard)? No, the e-postcard system is completely free.

Configuring and Monitoring AS400 Servers. eg Enterprise v5.6

CSAT Account Management

NWIRP Phone System Quick Start Guide Version /07/2009

esupport Quick Start Guide

Success in Mathematics

Arjun V. Bala Page 25

Using McAllister Payment Solutions and Updating to AVImark version

Licensing Windows Server 2012 R2 for use with virtualization technologies

FundingEdge. Guide to Business Cash Advance & Bank Statement Loan Programs

Board Notes on Virtual Memory

ViPNet VPN in Cisco Environment. Supplement to ViPNet Documentation

How To Install Fcus Service Management Software On A Pc Or Macbook

Password Reset for Remote Users

In addition to assisting with the disaster planning process, it is hoped this document will also::

Access EEC s Web Applications... 2 View Messages from EEC... 3 Sign In as a Returning User... 3

W4118: segmentation and paging. Instructor: Junfeng Yang

LOGOS Purchase Agreement How will you acquire this valuable digital tool?

Perl for OpenVMS Alpha

DET Video Conference Network. Polycom. VSX Series 7000

efusion Table of Contents

Maximizing Virtual Machine Performance

Regions File Transmission

Dreamweaver MX Templates

Chapter - 3. Cable Connections

Calling from a Cell Phone

AMWA Chapter Subgroups on LinkedIn Guidance for Subgroup Managers and Chapter Leaders, updated

Remote Desktop Tutorial. By: Virginia Ginny Morris

Software Update Notification

Serv-U Distributed Architecture Guide

Instructions for Certify

DIRECT DATA EXPORT (DDE) USER GUIDE

The 3Dnet Cloud - are you connected yet?

Microsoft Exchange 2010 on VMware Design and Sizing Examples

How To Migrate To A Networks Dmain Name Service On A Pc Or Macbook (For Pc) On A Linux Computer (For Macbook) On An Ipad Or Ipad (For Ipad) On Pc Or Ipa (For

Helpdesk Support Tickets & Knowledgebase

Budget Planning. Accessing Budget Planning Section. Select Click Here for Budget Planning button located close to the bottom of Program Review screen.

FOCUS Service Management Software Version 8.5 for CounterPoint Installation Instructions

edoc Lite Recruitment Guidelines

Transcription:

Memry and Address Translatin Review Prgram addresses are virtual addresses. Relative set rgram regins can nt change during rgram executin. E.g., hea can nt mve urther rm cde. addresses == hysical address incnvenient. Prgram lcatin is cmiled int the rgram. A single set register allws the OS t lace a rcess virtual address sace anywhere in hysical memry. address sace must be smaller than hysical. Prgram is swaed ut ld lcatin and swaed int new. Segmentatin creates external ragmentatin and requires large regins cntiguus hysical memry. We lk t ixed sized units, memry ages, t slve the rblem. 2

Memry Cncet Key rblem: Hw can ne surt rgrams that require mre memry than is hysically available? Hw can we surt rgrams that d nt use all their memry at nce? Hide hysical size memry rm users Memry is a large virtual address sace 2 n bytes Only rtins VAS are in hysical memry at any ne time (increase memry utilizatin). Issues Placement strategies Where t lace rgrams in hysical memry Relacement strategies What t d when there exist mre rcesses than can it in memry Lad cntrl strategies Determining hw many rcesses can be in memry at ne time 2 n - 0 Prgram P s VAS 3 Realizing Memry Paging ( MAX -, MAX -) memry artitined int equal sized age rames Page rames avid external ragmentatin. A memry address is a air (, ) rame number ( max rames) rame set ( max bytes/rames) address = max + (,) Memry PA: lg 2 ( max max ) lg 2 max (0,0) 4

Address Seciicatins Frame/Oset air v. An abslute index Examle: A 6-bit address sace with ( max =) 52 byte age rames Addressing lcatin (3, 6) =,542 (3,6),542 PA: 0 0 0 0 0 0 0 0 0 0 0 6 3 6 0 9,542 0 Memry (0,0) 0 5 Questins The set is the same in a virtual address and a hysical address. A. True B. False I yur level data cache is equal t r smaller than 2 number age set bits then address translatin is nt necessary r a data cache tag check. A. True B. False 6

Realizing Memry Paging A rcess s virtual address sace is artitined int equal sized ages age = age rame A virtual address is a air (, ) age number ( max ages) age set ( max bytes/ages) address = max + 2 n - = ( MAX -, MAX -) (,) Address Sace VA: lg 2 ( max max ) lg 2 MAX (0,0) 7 Paging Maing virtual addresses t hysical addresses Address Sace Pages ma t rames Pages are cntiguus in a VAS... But ages are arbitrarily lcated in hysical memry, and Nt all ages maed at all times (, ) ( 2, 2 ) (, ) Memry ( 2, 2 ) 8

Frames and ages Only maing virtual ages that are in use des what? A. Increases memry utilizatin. B. Increases errmance r user alicatins. C. Allws an OS t run mre rgrams cncurrently. D. Gives the OS reedm t mve virtual ages in the virtual address sace. Address translatin is A. Frequent B. Inrequent Changing address maings is A. Frequent B. Inrequent 9 Paging address translatin Prgram P A age table mas virtual ages t hysical rames (,) CPU P s Address Sace (,) 20 0 9 6 0 9 Memry Page Table 0

Address Translatin Details Page table structure table er rcess Part rcess s state Cntents: Flags dirty bit, resident bit, clck/reerence bit Frame number CPU 20 0 9 6 0 9 PTBR + 0 0 Page Table Address Translatin Details Examle P s Address Sace (4,0) (3,023) CPU 5 0 9 A system with 6-bit addresses 32 KB hysical memry 024 byte ages 0 0 0 0 0 0 0 0 0 0 0 0 0 4 9 0 (4,023) 0 Memry Page Table (0,0) 2

Address Translatin Perrmance Issues Prblem VM reerence requires 2 memry reerences! One access t get the age table entry One access t get the data Page table can be very large; a art the age table can be n disk. Fr a machine with 64-bit addresses and 024 byte ages, what is the size a age table? What t d? Mst cmuting rblems are slved by sme rm Caching Indirectin 3 Address Translatin Using TLBs t Seedu Address Translatin CPU 20 0 9 Cache recently accessed age-t-rame translatins in a TLB Fr TLB hit, hysical age number btained in cycle Fr TLB miss, translatin is udated in TLB Has high hit rati (why?) 6 0 9? Key Value TLB X Page Table 4

Dealing With Large Page Tables Multi-level aging Add additinal levels indirectin t the age table by sub-dividing age number int k arts Create a tree age tables TLB still used, just nt shwn The architecture determines the number levels age table Secnd-Level Page Tables 2 2 Address 3 3 First-Level Page Table Third-Level Page Tables 5 Dealing With Large Page Tables Multi-level aging Examle: Tw-level aging CPU Memry 2 20 6 0 6 0 PTBR + age table + 2 First-Level Page Table Secnd-Level Page Table 6

The Prblem Large Address Saces With large address saces (64-bits) rward maed age tables becme cumbersme. E.g. 5 levels tables. Instead making tables rrtinal t size virtual address sace, make them rrtinal t the size hysical address sace. address sace is grwing aster than hysical. Use ne entry r each hysical age with a hash table Size translatin table ccuies a very small ractin hysical memry Size translatin table is indeendent VM size 7 Address Translatin Using Page Registers (aka Inverted Page Tables) Each rame is assciated with a register cntaining Residence bit: whether r nt the rame is ccuied Occuier: age number the age ccuying rame Prtectin bits Page registers: an examle memry size: 6 MB Page size: 4096 bytes Number rames: 4096 Sace used r age registers (assuming 8 bytes/register): 32 Kbytes Percentage verhead intrduced by age registers: 0.2% Size virtual memry: irrelevant 8

Page Registers Hw des a virtual address becme a hysical address? CPU generates virtual addresses, where is the hysical age? Hash the virtual address Must deal with cnlicts TLB caches recent translatins, s age lku can take several stes Hash the address Check the tag the entry Pssibly rehash/traverse list cnlicting entries TLB is limited in size Diicult t make large and accessible in a single cycle. They cnsume a lt wer (27% n-chi r StrngARM) 9 Dealing With Large Inverted Page Tables Using Hash Tables Hash age numbers t ind crresnding rame number Page rame number is nt exlicitly stred ( rame er entry) Prtectin, dirty, used, resident bits als in entry 20 9 CPU Address PID running 6 9 Memry PTBR Hash =? =? tag check + PID age 0 max max 2 h(pid, ) Inverted Page Table 0 20

Searching Inverted Page Tables Using Hash Tables Page registers are laced in an array Page i is laced in slt (i) where is an agreed-un hash unctin T lku age i, errm the llwing: Cmute (i) and use it as an index int the table age registers Extract the crresnding age register Check i the register tag cntains i, i s, we have a hit Otherwise, we have a miss 2 Searching the Inverted Page Table Using Hash Tables (Cnt d.) Minr cmlicatin Since the number ages is usually larger than the number slts in a hash table, tw r mre items may hash t the same lcatin Tw dierent entries that ma t same lcatin are said t cllide Many standard techniques r dealing with cllisins Use a linked list items that hash t a articular table entry Rehash index until the key is und r an emty table entry is reached (en hashing) 22

Questins Why use inverted age tables? A. Frward maed age tables are t slw. B. Frward maed age tables dn t scale t larger virtual address saces. C. Inverted ages tables have a simler lku algrithm, s the hardware that imlements them is simler. D. Inverted age tables allw a virtual age t be anywhere in hysical memry. 23 Memry (Paging) The bigger icture A rcess s VAS is its cntext Cntains its cde, data, and stack Cde ages are stred in a user s s ile n disk Sme are currently residing in memry; mst are nt Data and stack ages are als stred in a ile Althugh this ile is tyically nt visible t users File nly exists while a rgram is executing OS determines which rtins a rcess s VAS are maed din memry at any ne time Cde Data Stack File System (Disk) OS/MMU Memry 24

Memry Page ault handling Memry Reerences t nn-maed ages generate a age ault CPU Page ault handling stes: Prcessr runs the interrut handler OS blcks the running rcess OS starts read the unmaed age OS resumes/initiates sme ther rcess Read age cmletes OS mas the missing age int memry OS restart the aulting rcess 0 Page Table Prgram P s VAS Disk 25 Memry Perrmance Page ault handling analysis T understand the verhead aging, cmute the eective memry access time (EAT) EAT = memry access time rbability a age hit + age ault service time rbability a age ault Examle: Memry access time: 60 ns Disk access time: 25 ms Let = the rbability a age ault EAT = 60( ) ( + 25,000,000, T realize an EAT within 5% minimum, what is the largest value we can tlerate? 26

Vista reading rm the ageile 27 Vista writing t the ageile 28

Memry Summary and virtual memry artitined int equal size units Size VAS unrelated t size hysical memry ages are maed t hysical rames Simle lacement strategy There is n external ragmentatin Key t gd errmance is minimizing age aults 29 Segmentatin vs. Paging Segmentatin has what advantages ver aging? A. Fine-grained rtectin. B. Easier t manage transer segments t/rm the disk. C. Requires less hardware surt D. N external ragmentatin Paging has what advantages ver segmentatin? A. Fine-grained rtectin. B. Easier t manage transer ages t/rm the disk. C. Requires less hardware surt. D. N external ragmentatin. 30