JERARQUÍA DE MEMORIA MEMORIA VIRTUAL SEMANA NO.15 SEMESTRE 2011-2 PROF. EUGENIO DUQUE PÉREZ PROF. GUSTAVO PATIÑO

Slides:



Advertisements
Similar presentations
1998 Morgan Kaufmann Publishers Mario Côrtes - MO401 - IC/Unicamp- 2004s2 Ch7b-1 Chapter Seven Sistemas de Memória parte B Memória Virtual.
Advertisements

SE-292 High Performance Computing
1 Circuitos Digitales II y Lab. Circuitos Digitales II y Lab. Arquitectura de Punto Flotante Semana No.14 Semestre Prof. Eugenio Duque Pérez
Chapter 4 Memory Management Basic memory management Swapping
Multilevel Page Tables
SE-292: High Performance Computing
Cache and Virtual Memory Replacement Algorithms
Circuitos Digitales II The General Computer Architecture The CPU Control unit Semana No.9 Semestre Prof. Gustavo Patiño Prof.
Circuitos Digitales II The General Computer Architecture The MIPS single-cycle datapath Semana No.8 Semestre Prof. Eugenio Duque
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
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
1 Lecture 13: Cache and Virtual Memroy Review Cache optimization approaches, cache miss classification, Adapted from UCB CS252 S01.
Virtual Memory main memory can act as a cache for secondary storage motivation: Allow programs to use more memory that there is available transparent to.
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.
CSIE30300 Computer Architecture Unit 10: Virtual Memory Hsin-Chou Chi [Adapted from material by and
Virtual Memory Hardware Support
Cs 325 virtualmemory.1 Accessing Caches in Virtual Memory Environment.
CSCE 212 Chapter 7 Memory Hierarchy Instructor: Jason D. Bakos.
Chap. 7.4: Virtual Memory. CS61C L35 VM I (2) Garcia © UCB Review: Caches Cache design choices: size of cache: speed v. capacity direct-mapped v. associative.
S.1 Review: The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management -3 CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
Review CPSC 321 Andreas Klappenecker Announcements Tuesday, November 30, midterm exam.
Recap. The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of the.
Chapter 7 Large and Fast: Exploiting Memory Hierarchy Bo Cheng.
The Memory Hierarchy II CPSC 321 Andreas Klappenecker.
Technical University of Lodz Department of Microelectronics and Computer Science Elements of high performance microprocessor architecture 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.
Memory: Virtual MemoryCSCE430/830 Memory Hierarchy: Virtual Memory CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy (Part II)
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 24 Instructor: L.N. Bhuyan
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.
Lecture 33: Chapter 5 Today’s topic –Cache Replacement Algorithms –Multi-level Caches –Virtual Memories 1.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
CMP 301A Computer Architecture 1 Lecture 4. Outline zVirtual memory y Terminology y Page Table y Translation Lookaside Buffer (TLB)
CSE431 L22 TLBs.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 22. Virtual Memory Hardware Support Mary Jane Irwin (
Lecture 19: Virtual Memory
CPE432 Chapter 5A.1Dr. W. Abu-Sufah, UJ Chapter 5B:Virtual Memory Adapted from Slides by Prof. Mary Jane Irwin, Penn State University Read Section 5.4,
1  2004 Morgan Kaufmann Publishers Multilevel cache Used to reduce miss penalty to main memory First level designed –to reduce hit time –to be of small.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
The Memory Hierarchy 21/05/2009Lecture 32_CA&O_Engr Umbreen Sabir.
IT253: Computer Organization
Virtual Memory Expanding Memory Multiple Concurrent Processes.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
1 Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: –illusion of having more physical memory –program relocation.
Virtual Memory. Virtual Memory: Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB)
2015/11/26\course\cpeg323-08F\Topic7e1 Virtual Memory.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Virtual Memory.  Next in memory hierarchy  Motivations:  to remove programming burdens of a small, limited amount of main memory  to allow efficient.
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.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
CS.305 Computer Architecture Memory: Virtual Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
3/1/2002CSE Virtual Memory Virtual Memory CPU On-chip cache Off-chip cache DRAM memory Disk memory Note: Some of the material in this lecture are.
CS203 – Advanced Computer Architecture Virtual Memory.
CS161 – Design and Architecture of Computer
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
Lecture 12 Virtual Memory.
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.
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSC3050 – Computer Architecture
Virtual Memory.
Presentation transcript:

JERARQUÍA DE MEMORIA MEMORIA VIRTUAL SEMANA NO.15 SEMESTRE PROF. EUGENIO DUQUE PÉREZ PROF. GUSTAVO PATIÑO 1 Arquitectura de Computadores Departamento de Ingeniería Electrónica Facultad de Ingeniería

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Virtual Memory 2 The main memory can act as a cache for the secondary storage, usually implemented with magnetic disks. This technique is called Virtual Memory. There are two major motivations for virtual memory: to allow efficient and safe sharing of memory among multiple programs and to remove the programming burdens of a small, limited amount of main memory.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Virtual Memory (…cont) 3 Main memory needs to contain only the active portions of the many programs, just as a cache contains only the active portion of one program. This allows us to efficiently share the processor as well as the main memory. Virtual memory implements the translation of a programs address space to physical addresses. This translations enforces protection of a programs address space from other programs.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Virtual Memory (…cont) 4 Virtual memory manages the two levels of the memory hierarchy represented by main memory (sometimes called physical memory to distinguish it from virtual memory) and secondary storage. Although the concepts at work in virtual memory and in caches are the same, their differing historical roots have led to the use of different terminlogy.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Terminology 5 Page : A block in the virtual memory. Page fault : A virtual memory miss. A page fault will take millions of cycles to process. This enormous miss penalty, dominated by the time to get the first word for typical page sizes, leads to several key decisions in designing virtual memory systems. Memory mapping (or address translation) : With virtual memory, the CPU produces a virtual address which is translated by a combination of HW and SW to a physical address, which in turn can be used to access main memory. Analogy : Virtual Address can be seen like book title Physical address like location of that book in the library.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Mapeo de Memoria 6

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Mapeo de Memoria (…cont) 7

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Mapeo de Memoria (…cont) 8 El número de bits en el page offset determina el tamaño de la página. El número de páginas direccionables con la dirección virtual no necesita corresponder con el número de páginas direccionables con la dirección física. Tener un número mayor de páginas virtuales, que el número de páginas físicas, es la base de la ilusión de una cantidad esencialmente ilimitada de memoria virtual.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Decisiones claves para el diseño de memoria virtual 9

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Placing a page and finding it again 10 If we allow a virtual page to be mapped to any physical page (fully associative placement), the operating system can then choose to replace any page it wants when a page faults occurs. Problems : it would be necessary a full search.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Placing a page and finding it again (…cont) 11 In virtual memory, we locate pages by using a full table that indexes the memory. This structure is called a page table. A page table is indexed with the page number from the virtual address and contains the corresponding physical page number.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Placing a page and finding it again (…cont) 12 Each program has its own page table, which maps the virtual address space of that program to main memory. To indicate the location of the page table in memory, the HW includes a register that points to the start of the page table. Page Table Register.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería The Page Table 13

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería The page table (…cont) 14 Because the page table contains a mapping for every possible virtual page, no tags are required. In cache terminology, the index, which is used to access the page table, consists of the full block address, which is the virtual page number.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería What happen with every program ? 15 The page table, together with the program counter and the registers, specifies the state of a program. If we want to allow another program to use the CPU, we must save this state. Later, after restoring this state, the program can continue execution. This state is often refer as a process. The process is considered active when it is in possesion of the CPU; otherwise, it is considered inactive. Rather than save the entire page table, the operating system symply loads the page table register to point to the page table of the process it wants to make active.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Making Address Translation Fast : The TLB 16 Since the page tables are stored in main memory, every memory access by a program can take at least twice as long: one memory access to obtain the physical address and a second access to get the data. The key to improving access performance is to rely on locality of reference to the page table. When a translation for a virtual page number is used, it will probably be needed again in the near future because the references to the words on that page have both temporal and spatial locality.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería The TLB 17 Accordinly, modern machines include a special cache that keeps track of recently used translations. This special address translation cache is traditionally referred to as a Translation Lookaside Buffer (TLB). The TLB is a cache that holds only page table mappings. Thus each tag entry in the TLB holds a portion of the virtual page number, and each data entry of the TLB holds a physical page number.

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería The TLB (…cont) 18

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Integrating Virtual Memory, TLBs and Caches 19

Departamento de Ing. Electrónica. Arquitectura de Computadores Facultad de Ingeniería Ejemplo del procesamiento de una condición de lectura o escritura en el procesador DECStation