Memory Thrashing Protection in Multi-Programming Environment Xiaodong Zhang Ohio State University In collaborations with Song Jiang (Wayne State University)

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: ,
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
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Memory Management 2010.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 9: Virtual Memory Background.
Chapter 10: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 10: Virtual Memory.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
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.
Computer Organization and Architecture
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual Memory.
OS Spring’04 Virtual Memory: Page Replacement Operating Systems Spring 2004.
CSCI2413 Lecture 6 Operating Systems Memory Management 2 phones off (please)
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.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
CSS430 Virtual Memory Textbook Ch9
Chapter 3 Memory Management: Virtual Memory
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
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.
Chapter 10 Operating Systems.
Memory Thrashing Protection in Multi-Programming Environment Xiaodong Zhang Ohio State University College of William and Mary In collaborations with Song.
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.
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.
Project Presentation By: Dean Morrison 12/6/2006 Dynamically Adaptive Prepaging for Effective Virtual Memory Management.
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.
Memory Thrashing Protection in Multi-Programming Environment
SLC/VER1.0/OS CONCEPTS/OCT'99
Memory Thrashing Protection in Multi-Programming Environment
William Stallings Computer Organization and Architecture
Chapter 8 Virtual Memory
Virtual Memory Chapter 8.
Module 9: Virtual Memory
O.S Lecture 13 Virtual Memory.
Chapter 9: Virtual-Memory Management
5: Virtual Memory Background Demand Paging
Operating Systems.
Virtual Memory: Working Sets
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 In collaborations with Song Jiang (Wayne State University)

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.  Memory underutilization: not adapting dynamics.  It is no longer used in any systems.  Load control:  While thrashing, some job(s) is/are suspended/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.  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 and Impact 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).  But it is recognized in the real world!  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-ordered LRU, renamed as Swap token, was formally adopted in Linux kernel 2.6.9, 12/04, serving millions of users world wide.

Impact of This Work (continued)  Swap token is introduced in book Understanding Linux Kernel (3rd edition), (Bovet and Casati)  Swap token is a section in Book Professional Linux Kernel Architecture  False LRU page concept is quoted in OS wiki.  Continued efforts on adaptive swap token in kernel:  Switch on/off the token adaptive to VM load changes.  Other alternative proposed in the paper.

The Evolution of Swap Token in Linux  First version: token is randomly given to a process  A time stamp is used to handover the token one by one  Limit 1: the token may not hit to the most desirable one  Limit 2: a constant time stamp may not address urgency  preempt swap token (current version)  A “priority counter” is set for each process to record the number of swap-out pages.  The counter is incremented for a unit of swap-out pages  The token is always to the process with high “priority”  The length of time stamp varies by the priority degree

Original version of Swap Token in Linux Kernel

Current version of Preempt Swap Token in Linux Kernel