3.1 Advanced Operating Systems Superpages TLB coverage is the amount of memory mapped by TLB. I.e. the amount of memory that can be accessed without TLB.

Slides:



Advertisements
Similar presentations
CS 443 Advanced OS David R. Choffnes, Spring 2005 Practical, transparent operating system support for superpages Juan Navarro, Sitaram Iyer, Peter Druschel,
Advertisements

Memory.
Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
1 Thursday, July 06, 2006 “Experience is something you don't get until just after you need it.” - Olivier.
Chapter 9: Virtual-Memory Management. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 9: Virtual Memory Background Demand Paging.
Segmentation and Paging Considerations
CSC 4250 Computer Architectures December 8, 2006 Chapter 5. Memory Hierarchy.
CS 153 Design of Operating Systems Spring 2015
Memory Management Design & Implementation Segmentation Chapter 4.
Memory Management (II)
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
Memory Management.
Memory Management 2010.
Chapter 3.2 : Virtual Memory
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Virtual Memory and Paging J. Nelson Amaral. Large Data Sets Size of address space: – 32-bit machines: 2 32 = 4 GB – 64-bit machines: 2 64 = a huge number.
Computer Organization and Architecture
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Chapter 8 Main Memory Bernard Chen Spring Objectives To provide a detailed description of various ways of organizing memory hardware To discuss.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Review of Memory Management, Virtual Memory CS448.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Lecture 19: Virtual Memory
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.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Practical, Transparent Operating System Support for Superpages J. Navarro Rice University and Universidad Católica de Chile S. Iyer, P. Druschel, A. Cox.
1 Linux Operating System 許 富 皓. 2 Memory Addressing.
CE Operating Systems Lecture 14 Memory management.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Memory.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
1 Practical, transparent operating system support for superpages Juan Navarro, Sitaram Iyer, Peter Druschel, Alan Cox OSDI 2002.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
Memory Management – Page 1CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: Memory Management *** Modified – look for Reading:
Memory Management Chapter 5 Advanced Operating System.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Practical, transparent operating system support for superpages Juan Navarro, Sitaram Iyer, Peter Druschel, Alan Cox OSDI 2002.
Memory Management.
Non Contiguous Memory Allocation
UNIT–IV: Memory Management
CS703 - Advanced Operating Systems
O.S Lecture 13 Virtual Memory.
Chapter 9: Virtual-Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
PRACTICAL, TRANSPARENT OPERATING SYSTEM SUPPORT FOR SUPERPAGES
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Memory Management-I 1.
CSE 542: Operating Systems
CSE 451: Operating Systems Autumn 2005 Memory Management
Virtual Memory Overcoming main memory size limitation
Chapter 8: Memory Management strategies
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 542: Operating Systems
COMP755 Advanced Operating Systems
Operating Systems: Internals and Design Principles, 6/E
Chapter 8 & 9 Main Memory and Virtual Memory
CSE 542: Operating Systems
Virtual Memory 1 1.
Presentation transcript:

3.1 Advanced Operating Systems Superpages TLB coverage is the amount of memory mapped by TLB. I.e. the amount of memory that can be accessed without TLB misses. Low TLB coverage can cause many unnecessary memory references. Large and complex TLBs make it difficult to attain short processor cycle times.

3.2 Advanced Operating Systems TLB coverage trend TLB coverage as percentage of main memory TLB miss overhead:  5% 5-10%  30% Factor of 1000 decrease in 15 years

3.3 Advanced Operating Systems Superpages Keywords Many processors achieve wider TLB coverage by supporting large pages in the TLB. These pages are called Superpages. The smaller pages using by the page table are called base pages. Promotion is the action of upgrading a set of base pages to a superpage in the TLB. Demotion is the opposite action of promotion.

3.4 Advanced Operating Systems Fragmentation Larger internal fragmentation. –Some base pages within the superpage can be unused, while the operating system decides to swap out another page. External fragmentation also can be. –Suppose superpage is N base pages and there are N free base frames, but they are not contiguous.

3.5 Advanced Operating Systems More Problems A thrashing can occur even when there are enough pages. The reading is less efficient. More data is read, but no guarantee that the data is going to be useful. –One dirty bit for a superpage can cause more I/O traffic too. The coarse granularity is not just of the dirty bit, but also of protection attributes (read, write, execute) and reference bit.

3.6 Advanced Operating Systems Multiple Page Size The "Pentium"s support just two sizes of pages – 4KB base pages and 4MB superpages. However, The "Alpha"s support 8KB base pages while the superpages are of 64KB, 512KB or 4MB. The "Itanium"s support 10 different page sizes from 4KB to 256MB. –4KB,8KB,16KB,64KB,256KB,1MB,4MB,16MB,64MB,256MB

3.7 Advanced Operating Systems Superpage Allocation virtual memory physical memory superpage boundaries B B A A C C D D virtual memory physical memory superpage boundaries BACD ABCD

3.8 Advanced Operating Systems Promotion Promotion is gathering some base pages into a superpages, or gathering some small superpages into a bigger superpage. When to promote? –Wait for the process to touch the base pages? May lose opportunity to increase TLB coverage. –Create a small superpage? May waste overhead. –Forcibly populate the base pages? May cause internal fragmentation.

3.9 Advanced Operating Systems Talluri's Superpages on 1994 Talluri and Hill suggested that the OS will try to allocate a base frame that is part of an available, contiguous range of base frames equal in size and alignment to the maximal desired superpage size. The promotion will be done, when the number of base frames in use reaches a promotion threshold. Under memory pressure the reserved area can be preempted.

3.10 Advanced Operating Systems Romer's Superpages On 1995 Romer et al. suggested to allocate base pages everywhere and on promotion to relocate them. –If a base page is move into an occupied frame, the old base page will be swapped out. If the old base page is non-pageable, another relocation is done. Due to the high price of promotions, the OS promotes pages just after a high number of TLB misses when the OS is convinced that the promotion can benefit the performance. The OS is more robust to fragmentation, but the performance is worse.

3.11 Advanced Operating Systems HP-UX and IRIX HP-UX is a Unix version on HP and IRIX is a Unix version on Silicon Graphics. The superpaging support in both of them were published on In both of these OSes, when a base page is faulted in, the system allocates several contiguous base frames to fault in surrounding base pages and immediately promote them into the maximal desired superpage. This approach is equivalents to Romer's superpages with a promotion threshold of one base page.

3.12 Advanced Operating Systems HP-UX and IRIX's superpage size The preferred superpage size is based on memory availability at allocation time and on a user-specified per-segment page size hint. –This hint is associated with an application binary's text and data segments (added by the compiler). –Size specified by the user is non-transparent and it is against Software Engineering rules. Both HP-UX and IRIX manage the "holes" in the memory by LRU lists for each of the superpage's sizes. –Any "hole" can be just in one LRU list.

3.13 Advanced Operating Systems More on IRIX IRIX has a coalescing daemon that relocates pages when it is possible, so a promotion can be done faster. IRIX is actually a hybrid approach of the reservation-based allocation and the relocation based allocation.

3.14 Advanced Operating Systems Hardware Support On 2001 Fang et al. suggested to solve the reallocation problem by a dedicated hardware. They introduced an additional level of address translation in the memory controller, so that the OS can promote non-adjacent physical pages into a superpage. Unfortunately, this new method is still not adapted by the CPU producers.

3.15 Advanced Operating Systems Demotion Convert a superpage into smaller pages. –Smaller pages can be smaller superpages or base pages. Traditionally demotion has been done under memory pressure when part of a superpage has been swapped out of the memory or when there is no room in the TLB.

3.16 Advanced Operating Systems Implicit Demotion On 2002 Navarro et al. suggested to demote clean superpages whenever a process attempts to write into them, and re-promote (incrementally) later if the other base pages are dirtied. His implementation was on FreeBSD running on an Alpha processor. In the original FreeBSD when a dirty superpage needs to be written to the disk, it will consider all the constituent base pages dirty. Demotion is also done whenever the protection attributes are changed on part of a superpage.

3.17 Advanced Operating Systems Wired Pages Scatter wired (non-pageable) base pages can be a bone in the throat. On 2002 Navarro suggested to reserve an area in the memory for wired allocation. –As a result the wired pages will be clustered.

3.18 Advanced Operating Systems Linux Traditionally Linux does not support superpages. On 2002 Winwood suggested a Linux version supporting superpages. The major deficiency of Linux is that it mainly runs on Pentium machines which have just two sizes of pages – 4KB and 4MB; hence undeveloped.