1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 2: The hardware view dr.ir. A.C. Verschueren.

Slides:



Advertisements
Similar presentations
SE-292 High Performance Computing
Advertisements

Chapter 4 Memory Management Basic memory management Swapping
Memory.
Page Table Implementation
SE-292: High Performance Computing
1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Virtual Memory In this lecture, slides from lecture 16 from the course Computer Architecture ECE 201 by Professor Mike Schulte are used with permission.
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
1/1/ / faculty of Electrical Engineering eindhoven university of technology Processor support devices Part 3:Memory management, floating point dr.ir. A.C.
1 Lecture 13: Cache and Virtual Memroy Review Cache optimization approaches, cache miss classification, Adapted from UCB CS252 S01.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 3: Multitasking and Memory.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
The Memory Hierarchy (Lectures #24) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer Organization.
Memory Management Norman White Stern School of Business.
Lecture 11: Memory Management
Memory Management 2010.
Memory Organization.
Chapter 3.2 : Virtual Memory
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Computer Organization Cs 147 Prof. Lee Azita Keshmiri.
©UCB CS 162 Ch 7: Virtual Memory LECTURE 13 Instructor: L.N. Bhuyan
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
VIRTUAL MEMORY. Virtual memory technique is used to extents the size of physical memory When a program does not completely fit into the main memory, it.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Speeding it up Part 2: Pipeline problems & tricks dr.ir. A.C. Verschueren Eindhoven.
Operating Systems Chapter 8
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
Lecture 15: Virtual Memory EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
IT253: Computer Organization
Operating Systems COMP 4850/CISG 5550 Page Tables TLBs Inverted Page Tables Dr. James Money.
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.
Memory and cache CPU Memory I/O. CEG 320/52010: Memory and cache2 The Memory Hierarchy Registers Primary cache Secondary cache Main memory Magnetic disk.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Implementation of Page Table Page table is kept in main memory Page-table base.
1 Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: –illusion of having more physical memory –program relocation.
CSE 241 Computer Engineering (1) هندسة الحاسبات (1) Lecture #3 Ch. 6 Memory System Design Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
9.1 Operating System Concepts Paging Example. 9.2 Operating System Concepts.
Introduction to Virtual Memory and Memory Management
Operating Systems Unit 7: – Virtual Memory organization Operating Systems.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Page Table Implementation. Readings r Silbershatz et al:
CHAPTER 3-3: PAGE MAPPING MEMORY MANAGEMENT. VIRTUAL MEMORY Key Idea Disassociate addresses referenced in a running process from addresses available in.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
Cache Small amount of fast memory Sits between normal main memory and CPU May be located on CPU chip or module.
CS161 – Design and Architecture of Computer
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Computer Organization
Memory Management Virtual Memory.
Processor support devices Part 2: Caches and the MESI protocol
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
Memory and cache CPU Memory I/O.
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
Consider a Direct Mapped Cache with 4 word blocks
Paging and Segmentation
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
Virtual Memory 4 classes to go! Today: Virtual Memory.
Memory and cache CPU Memory I/O.
Lecture 29: Virtual Memory-Address Translation
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSC3050 – Computer Architecture
Computer Architecture
COMP755 Advanced Operating Systems
Chapter Contents 7.1 The Memory Hierarchy 7.2 Random Access Memory
Presentation transcript:

1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 2: The hardware view dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital Information Systems

1/1/ / faculty of Electrical Engineering eindhoven university of technology Address translation Not needed for linear memory organisation –Processor generated (logical) address real memory (physical) address –May be handy to attach access rights to addresses Needed for multiple linear address spaces and segmented memories –Complex for multiple linear address spaces the actual address must be checked

1/1/ / faculty of Electrical Engineering eindhoven university of technology Table based direct address translation This table grows very large: Translating 1 million addresses with 4 access rights bits requires a 3 MegaByte table! access rights logical address physical address

1/1/ / faculty of Electrical Engineering eindhoven university of technology '<' compare '>=' compare Address bounds checking (1) logical address physical address physical offset access rights

1/1/ / faculty of Electrical Engineering eindhoven university of technology Address bounds checking (2) Parallel comparators are VERY expensive –Use a lot of power and chip area –Number of address ranges would be limited Physical address ranges must have same sizes as the logical address ranges –Memory which is organised into large (undividable) blocks is hard to manage –Same problem in a purely segmented memory

1/1/ / faculty of Electrical Engineering eindhoven university of technology 'page table' logical address Paging (1) bits of the address are not translated: 2 p words in a page have the same access rights access rights physical page logical page offset physical address

1/1/ / faculty of Electrical Engineering eindhoven university of technology Paging (2) Paging is cheaper than full address translation –Translating 1 million addresses with 1024 word pages requires a page table with only 1024 entries –With 10 bits physical page numbers and 4 access rights bits, the page table takes less than 2048 bytes! Translating 32 bit addresses with 4096 word pages requires a page table with 1 million entries! –Not all of these pages will be in use at the same time...

1/1/ / faculty of Electrical Engineering eindhoven university of technology logical address Second level page table First level page table Multi-level paging 2nd level table present page offset physical address Physical page access rights 2nd level table index 1st level table index

1/1/ / faculty of Electrical Engineering eindhoven university of technology Multi-level paging example 4 byte words, 32 bit addresses (2 bits select byte), 1024 word / 4096 byte pages ( = 10+2 bits) –Second level table: 1024 entries( = 10 bits) Entry contains 20 bit physical page number ( = 20), leaves 12 bits for access rights if each entry takes one word Each second level page table fits in one page –First level page table: 1024 entries( = 10 bits) Entry contains 20 bits physical page number of 2nd level table plus the 'table present bit' - fits easily in one word First level page table fits in one page

1/1/ / faculty of Electrical Engineering eindhoven university of technology Multi-level paging (continued) This address translation method is very cheap –The example second level table handles 4 MegaByte If code, data and stack fit in 8 MegaByte, we need 3 pages (12 KiloBytes) for translation Multi-level paging is not limited to 2 levels! –Motorola can go up to FIVE levels of tables Each table entry (not just the last) can specify access rights, can also give length limit for next table Searching through 5 tables for each memory access is a bit slow

1/1/ / faculty of Electrical Engineering eindhoven university of technology logical address '=' compare Speedup: translation lookaside buffer This 'Content Addressable Memory' lookaside buffer can reach 98% hits with only 32 entries page offset physical address access rights 'hit!' tag

1/1/ / faculty of Electrical Engineering eindhoven university of technology logical address A 'set associative' lookaside buffer access rights physical page physical address 'hit!' 'tag' Cheap, simple RAM

1/1/ / faculty of Electrical Engineering eindhoven university of technology The problem with set associative buffers A tag clash makes the lookaside buffer worthless –Two or more different pages used in short loop –With same bits but different (tag) bits WaitHereat address 35E6 h DataPortat address 5537 h 4 bit 8 bit 35E WaitHere:JNB DataPort.1,WaitHere Same line in table But different translation tags TWO misses per loop !

1/1/ / faculty of Electrical Engineering eindhoven university of technology logical address N-way set associative lookaside buffers Reduce (but do not solve) tag clashes physical page physical address Page table 1 Page table 2 mux 'hit!' hit logic 'tag' Tag table 1 Tag table 2 a.r. 1 a.r. 2 access rights mux set selection Same hit-rate as Content Addressable

1/1/ / faculty of Electrical Engineering eindhoven university of technology Lookaside buffer replacement strategy With filled buffer, new translations replace old –With 1-way set associative: bits fix choice! Best choice: remove one which will not be used –Difficult, but Least Recently Used may be the same –LRU requires administration: small choice sets only –Used for N-way set associative lookaside buffers Another strategy: remove one at random –Works well with large choice sets (CAM buffers!) –Small probability of removing the wrong entry

1/1/ / faculty of Electrical Engineering eindhoven university of technology logical address Segmented memory address translation Segment table is in main memory ! access rights offset segment 'stack' physical address Segment bases error! ' Segment limits

1/1/ / faculty of Electrical Engineering eindhoven university of technology Segmented translation speedup Processor uses only a few segments at once –Place currently used segment info in on-chip registers –Software decides which segments are loaded no replacement strategy needed in hardware! Example: Intel uses 6 current segments –Code, stack and default data –Up to 3 extra data segments referenced explicitly

1/1/ / faculty of Electrical Engineering eindhoven university of technology '0' '-1' address space The old-fashioned way: windowing Selection register is normally an output port –Window selection is part of memory management –Should be managed by operating system! window selection register 0 1 N - 2 N - 1 'N' windows mux Expanded Memory 1 1 N - 1