Memory Thrashing Protection in Multi-Programming Environment Xiaodong Zhang Ohio State University College of William and Mary In collaborations with Song.

Slides:



Advertisements
Similar presentations
Module 10: Virtual Memory
Advertisements

Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Virtual Memory (II) CSCI 444/544 Operating Systems Fall 2008.
Paging: Design Issues. Readings r Silbershatz et al: ,
Chapter 8 Virtual Memory
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Allocation of Frames Each process needs minimum number of pages
Operating Systems Prof. Navneet Goyal Department of Computer Science & Information Systems BITS, Pilani.
Page 15/4/2015 CSE 30341: Operating Systems Principles Allocation of Frames  How should the OS distribute the frames among the various processes?  Each.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 38 Frame Allocation Read.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 15: Background Information for the VMWare ESX Memory Management.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement.
Module 9: Virtual Memory
Module 10: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing.
Virtual Memory Background Demand Paging Performance of Demand Paging
Virtual Memory Introduction to Operating Systems: Module 9.
Memory Management Design & Implementation Segmentation Chapter 4.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
High Performance Computing and Software Lab, W&M ALS '01, 11/10/ Adaptive Page Replacement to Protect Thrashing in Linux Song Jiang, Xiaodong Zhang.
ECE 7995 Caching And Prefetching Techniques In Computer System Professor: Dr. Song Jiang.
Operating System Support Focus on Architecture
1 Virtual Memory vs. Physical Memory So far, all of a job’s virtual address space must be in physical memory However, many parts of programs are never.
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
Memory Management 2010.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
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.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Revisiting Virtual Memory.
Computer Organization and Architecture
OS Spring’04 Virtual Memory: Page Replacement Operating Systems Spring 2004.
03/29/2004CSCI 315 Operating Systems Design1 Page Replacement Algorithms (Virtual Memory)
1 Token-ordered LRU an Effective Policy to Alleviate Thrashing Presented by Xuechen Zhang, Pei Yan ECE7995 Presentation.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
CSS430 Virtual Memory Textbook Ch9
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Page 19/17/2015 CSE 30341: Operating Systems Principles Optimal Algorithm  Replace page that will not be used for longest period of time  Used for measuring.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Second-Chance Algorithm Basically, it’s a FIFO algorithm When a page has been selected, we inspect its reference bit. If the value is 0, we proceed to.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Page Replacement Allocation of.
Lecture 11 Page 1 CS 111 Online Working Sets Give each running process an allocation of page frames matched to its needs How do we know what its needs.
Memory Thrashing Protection in Multi-Programming Environment Xiaodong Zhang Ohio State University In collaborations with Song Jiang (Wayne State University)
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
CS 3204 Operating Systems Godmar Back Lecture 21.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Memory Management. Why memory management? n Processes need to be loaded in memory to execute n Multiprogramming n The task of subdividing the user area.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Memory Thrashing Protection in Multi-Programming Environment
SLC/VER1.0/OS CONCEPTS/OCT'99
Memory Thrashing Protection in Multi-Programming Environment
Chapter 8 Virtual Memory
Virtual Memory Chapter 8.
Module 9: Virtual Memory
O.S Lecture 13 Virtual Memory.
Chapter 9: Virtual-Memory Management
What Happens if There is no Free Frame?
5: Virtual Memory Background Demand Paging
Chapter 9: Virtual Memory
Virtual Memory: Working Sets
Operating Systems Concepts
Module 9: Virtual Memory
COMP755 Advanced Operating Systems
Chapter 9: Virtual Memory CSS503 Systems Programming
Presentation transcript:

Memory Thrashing Protection in Multi-Programming Environment Xiaodong Zhang Ohio State University College of William and Mary In collaborations with Song Jiang (Los Alamos National Laboratory)

Memory Management for Multiprogramming  Space sharing among interactive programs in virtual memory is managed by page replacement.  Commonly used policy is the global LRU replacement in the entire user memory space.  Thrashing: accumulated memory requests of multiple programs exceed available user space,  No program is able to establish its working set;  causing large page faults;  low CPU utilization; and  execution of each program practically stops.

Past and Existing Thrashing Protection Methods  Local page replacement:  Each program is statically allocated a fixed size.  DEC VAX machine had this in its VMS in early 1980’s.  Two problems: (1) under utilization of memory space, and (2) could not adapt dynamic changes of programs.  It is no longer used in any systems.  Load control:  While thrashing, some job(s) is/are suspend or swapped.  Open BSD operating systems, IBM RS/6000, HP9000.  HP-UX has a ``serialize()” command for thrashing.  Linux makes load controls based on RSS (resident set size) reporting the total number of occupied pages.

Limits and Problems of Load Controls  A thrashing is often triggered by a brief spike of memory demand, a load control can over-react.  Suspending a job causes other related jobs to quit.  When a job is suspended, its working set can be replaced quickly by other running programs, very expensive to rebuild the working set.  A lightweight and dynamic protection is much more desirable than a brute-force action.

Some Insights into Thrashing  The global LRU replacement generates two types of LRU pages for replacement:  True LRU pages: to which programs do not need to access.  False LRU pages: to which programs have not been able to access due to required working set is not set up yet, or page faults are being conducted.  A system cannot distinguish true or false LRU pages, but selects both for replacement.  The amount false LRU pages is a status indicator: no, marginally, or seriously thrashing.

Token-based Thrashing Protection Facility  Jiang/Zhang, Performance Evaluation, 05, (W&M).  Conducted intensive experiments at the kernel level along with analysis on memory thrashing:  A sudden spike of memory demand from one can generate many false LRU pages in others, particularly in an less demanding one.  As false pages reach to a certain amount, the system becomes little productive even when physical memory is not too small.  Basic idea of the token mechanism:  As the system enters a pre-thrashing stage (low RSS, and high idle CPU), a token is issued to a process so that it can quickly form its working set and proceed.  This approach can effectively and timely avoid thrashing.

Some Alternatives in Its Implementation  Which process to issue the token?  A less memory demanding process.  How long does a process hold the token?  It is adjustable and proportional to the thrashing degree.  What happens if thrashing is too serious?  It becomes a polite load control mechanism by setting a long token time so that each program has to be executed one by one.  Multi-tokens can be effective for light thrashing.  The token and its variations were implemented and tested in Linux kernel 2.2.

Outcome of This Work  A paper entitled ``Token-ordered LRU: …” has been rejected by several top system conferences. (Main reason: this is not a hot OS topic anymore).  A successful technology transfer based on it!  A group of independent Linux kernel developers organized by Rik van Reil of RedHat started a project to include the token into the Linux kernel in July  The implementation insights and detailed technical discussions are well documented in the Internet.  Token was formally adopted in Linux kernel 2.6., 12/04, serving millions of users world wide.