|
|
- Emily Smith
- 5 years ago
- Views:
Transcription
1 ADRIAN PERRIG & TORSTEN HOEFLER ( -6- ) Networks and Operatng Systems Chapter 6: Demand Pagng Page Table Structures Page table structures Page table structures Problem: smple lnear table s too bg Problem: smple lnear table s too bg Solutons:. Herarchcal tables. Vrtual tables. Hashed tables. Inverted tables Solutons:. Herarchcal tables. Vrtual tables (VAX). Hashed tables. Inverted tables Saw these last Semester. # Hashed Page Tables Hashed Page Table VPN s hashed nto table Hash bucket has chan of logcal-> mappngs Hash chan s traversed to fnd match. Can be fast, but can be unpredcable Often used for Portablty Software-loaded TLBs (e.g., MIPS) logcal p d r d hash functon q s p r hash table
2 # Inverted Page Table Inverted Page Table Archtecture One system-wde table now maps PFN -> VPN One entry for each real of Contans VPN, and whch process owns the Bounds total sze of all nformaton on machne Hashng used to locate an entry effcently Examples: PowerPC, a6, UltraSPARC CPU logcal pd p d d Physcal search pd p table The need for more bookkeepng Most OSes keep ther own translaton nfo Per-process herarchcal table (Lnux) System wde nverted table (Mach, MacOS) Why? Portablty Trackng objects Software vrtual translaton Physcal vrtual translaton TLB shootdown TLB management TLB management Recall: the TLB s a cache. Machnes have many MMUs on many cores many TLBs Problem: TLBs should be coherent. Why? Securty problem f mappngs change E.g., when s reused Core Core Core Process ID VPN PPN acces s x x r/w xf8 x r/w x x r/w x x read xf8 x r/w x x read
3 TLB management TLB management Core Core Process ID VPN PPN acces s x x r/w xf8 x r/w x x r/w x x read Change to read only Core Core Process ID VPN PPN acces s x x r/w xf8 x r/w! x x r/w x x read Change to read only Core xf8 x r/w x x read Core xf8 x r/w x x read TLB management Core Core Core Process ID VPN PPN acces s x x r/w xf8 x r/w! x x r/w x x read xf8 x r/w x x read Change to read only Process on core can only contnue once shootdown s complete! Keepng TLBs consstent. Hardware TLB coherence Integrate TLB mgmt wth cache coherence Invaldate TLB entry when PTE changes Rarely mplemented. Vrtual caches Requred cache flush / nvaldate wll take care of the TLB Hgh context swtch cost! Most processors use caches. Software TLB shootdown Most common OS on one core notfes all other cores - Typcally an IPI Each core provdes local nvaldaton 6. Hardware shootdown nstructons Broadcast specal access on the bus Interpreted as TLB shootdown rather than cache coherence message E.g., PowerPC archtecture Our Small Quz True or false (rase hand) Base (relocaton) and lmt regsters provde a full vrtual Base and lmt regsters provde protecton Segmentaton provdes a base and lmt for each segment Segmentaton provdes a full vrtual Segmentaton allows shared lbrares Segmentaton provdes lnear ng Segment tables are set up for each process n the CPU Segmentng prevents nternal fragmentaton Pagng prevents nternal fragmentaton Protecton nformaton s stored at the frame Pages can be shared between processes The same may be wrteable n proc. A and wrte protected n proc. B The same can be references through dfferent es from (a) two dfferent processes (b) the same process? Inverted tables are faster to search than herarchcal (asymptotcally) Today Uses for vrtual Copy-on-wrte Demand pagng Page fault handlng Page replacement algorthms Frame allocaton polces Thrashng and workng set 7
4 Recap: Vrtual Memory The many uses of translaton User logcal. Only part of the program must be n RAM for executon Logcal can be larger than Address s can be shared by several processes More effcent process creaton Vrtualze usng software+hardware Process solaton Memory mapped fles IPC Vrtual Shared code segments Checkpont and restart Program ntalzaton Persstent data structures Effcent dynamc allocaton Process mgraton Cache management Informaton flow control Program debuggng Dstrbuted shared Effcent I/O and many more Recall fork() Copy-on-wrte (COW) Can be expensve to create a complete copy of the process Especally just to do exec()! vfork(): shares, doesn t copy Fast Dangerous two wrters to same heap Better: only copy when you know somethng s gong to get wrtten Copy-on-Wrte Example: processes sharng an area of COW allows both parent and chld processes to ntally share the same s n If ether process modfes a shared, only then s the coped COW allows more effcent process creaton as only modfed s are coped A B Free s are allocated from a pool of zeroed-out s C Process Process
5 Example: processes sharng an area of How does t work? A B C Not necessarly the same vrtual es (but would be after fork()) Intally mark all s as read-only Ether process wrtes fault Fault handler allocates new frame Makes copy of n new frame Maps each copy nto resp. processes wrteable Only modfed s are coped Less usage, more sharng Cost s fault for each mutated Process Process After process wrtes to C After process wrtes to C A A Stll read-only B B C C copy of C copy of C Process Process Process Process After process wrtes to C General prncple Mark a VPN as nvald or readonly trap ndcates attempt to read or wrte On a fault, change mappngs somehow Restart nstructon, as f nothng had happened A B Stll read-only General: allows emulaton of as well as multplexng. E.g. on-demand zero-fllng of s And Now wrteable C copy of C Process Process
6 Pagng concepts Pagng concepts -resdent " " v vrtual table dsk v vrtual table dsk Pagng concepts Pagng concepts Wrte drty s out to dsk v vrtual " Keep track of where s are on dsk table dsk v vrtual " Keep track of where s are on dsk table dsk Pagng concepts Demand Pagng Read n s from dsk on demand Brng a nto only when t s needed Less I/O needed Less needed Faster response More users " Turns RAM nto a cache for processes on dsk! v vrtual table dsk 6
7 Demand Pagng Page needed reference (load or store) to t nvald reference abort not-n- brng to Lazy swapper never swaps a nto unless wll be needed Swapper that deals wth s s a r Can do ths wth segments, but more complex Strct demand pagng: only n when referenced Page Fault If there s a reference to a, frst reference to that wll trap to operatng system: fault. Operatng system looks at another table to decde: Invald reference abort Just not n. Get empty frame. Swap nto frame. Reset tables. Set valdaton bt = v 6. Restart the nstructon that caused the fault Recall: handlng a fault Recall: handlng a fault ExcepIon Page fault handler CPU Chp CPU VA MMU PTEA PTE Cache/ Memory Dsk CPU Chp CPU VA MMU PTEA PTE Cache/ Memory Dsk ) Processor sends vrtual to MMU -) MMU fetches PTE from table n ) Vald bt s zero, so MMU trggers fault excepton ) Handler dentfes vctm (and, f drty, s t out to dsk) 6) Handler s n new and updates PTE n 7) Handler returns to orgnal process, restartng faultng nstructon ) Processor sends vrtual to MMU -) MMU fetches PTE from table n ) Vald bt s zero, so MMU trggers fault excepton ) Handler dentfes vctm (and, f drty, s t out to dsk) 6) Handler s n new and updates PTE n 7) Handler returns to orgnal process, restartng faultng nstructon Recall: handlng a fault Recall: handlng a fault ExcepIon Page fault handler ExcepIon Page fault handler CPU Chp CPU VA MMU PTEA PTE Cache/ Memory Dsk CPU Chp CPU VA MMU PTEA PTE Cache/ Memory New 6 Dsk ) Processor sends vrtual to MMU -) MMU fetches PTE from table n ) Vald bt s zero, so MMU trggers fault excepton ) Handler fnds a frame to use for mssng 6) Handler s n new and updates PTE n 7) Handler returns to orgnal process, restartng faultng nstructon ) Processor sends vrtual to MMU -) MMU fetches PTE from table n ) Vald bt s zero, so MMU trggers fault excepton ) Handler fnds a frame to use for mssng 6) Handler s n new and updates PTE n 7) Handler returns to orgnal process, restartng faultng nstructon 7
8 Recall: handlng a fault ExcepIon Page fault handler Performance of demand pagng Page Fault Rate p. f p = no faults f p =, every reference s a fault CPU Chp CPU VA 7 MMU PTEA Cache/ Memory ) Processor sends vrtual to MMU -) MMU fetches PTE from table n ) Vald bt s zero, so MMU trggers fault excepton ) Handler fnds a frame to use for mssng 6) Handler s n new and updates PTE n 7) Handler returns to orgnal process, restartng faultng nstructon PTE New 6 Dsk Effectve Access Tme (EAT) EAT = ( p) x access + p ( fault overhead + swap out + swap n + restart overhead ) Demand pagng example Memory access tme = nanoseconds Average -fault servce tme = 8 mllseconds EAT = ( p) x + p (8 mllseconds) = ( p) x + p x 8,, = + p x 7,999,8 Page Replacement If one access out of, causes a fault, then EAT = 8. mcroseconds. Ths s a slowdown by a factor of!! What happens f there s no free frame? Page replacement fnd lttle used resdent to dscard or wrte to dsk vctm algorthm performance want an algorthm whch wll result n mnmum number of faults Same may be brought nto several tmes Page replacement Try to pck a vctm whch won t be referenced n the future Varous heurstcs but ultmately t s a guess Use modfy bt on PTE Don t wrte clean (unmodfed) to dsk Try to pck clean s over drty ones (save a dsk wrte) 8
9 Page replacement Page replacement frame vald frame vald. Swap vctm to dsk f v f vctm f v f vctm Page table Page table Physcal Physcal Page replacement Page replacement frame vald. Swap vctm to dsk frame vald f vctm f vctm. Change vctm PTE to nvald Page table Page table. Load desred n from dsk Physcal Physcal Page replacement Page replacement algorthms Want lowest -fault rate frame vald f v Page table. Change fault PTE to vald f vctm Evaluate algorthm by runnng t on a partcular strng of references (reference strng) and computng the number of faults on that strng E.g. 7,,,,,,,,,,,,,,,,, 7,,. Load desred n from dsk Physcal 9
10 Page faults vs. number of frames FIFO (Frst-In-Frst-Out) replacement Very lttle : thrashng (see later) What we mght expect reference strng: 7 7 Number of faults Plenty of : more doesn t help much Number of frames FIFO (Frst-In-Frst-Out) replacement FIFO (Frst-In-Frst-Out) replacement reference strng: 7 7 reference strng: FIFO (Frst-In-Frst-Out) replacement FIFO (Frst-In-Frst-Out) replacement reference strng: 7 7 reference strng:
11 FIFO (Frst-In-Frst-Out) replacement FIFO (Frst-In-Frst-Out) replacement reference strng: 7 7 reference strng: FIFO (Frst-In-Frst-Out) replacement FIFO (Frst-In-Frst-Out) replacement reference strng: 7 7 reference strng: Here, faults. More s better? More s better? Reference strng:,,,,,,,,,,, Reference strng:,,,,,,,,,,, frames ( s can be n ): Belady s Anomaly: more frames more faults Belady s Anomaly: more frames more faults
12 More s better? More s better? Reference strng:,,,,,,,,,,, frames ( s can be n ): Reference strng:,,,,,,,,,,, frames ( s can be n ): Belady s Anomaly: more frames more faults Belady s Anomaly: more frames more faults More s better? More s better? Reference strng:,,,,,,,,,,, frames ( s can be n ): Reference strng:,,,,,,,,,,, frames ( s can be n ): 9 faults Belady s Anomaly: more frames more faults Belady s Anomaly: more frames more faults More s better? More s better? Reference strng:,,,,,,,,,,, frames ( s can be n ): Reference strng:,,,,,,,,,,, frames ( s can be n ): 9 faults 9 faults Belady s Anomaly: more frames more faults Belady s Anomaly: more frames more faults
13 More s better? More s better? Reference strng:,,,,,,,,,,, frames ( s can be n ): Belady s Anomaly: more frames more faults 9 faults faults! Reference strng:,,,,,,,,,,, frames ( s can be n ): Belady s Anomaly: more frames more faults 9 faults faults! FIFO showng Belady s Anomaly Optmal algorthm Replace that wll not be used for longest perod of tme Number of faults frames example: 6 faults Number of frames How do you know ths? you can t! Used for measurng how well your algorthm performs Optmal replacement Least Recently Used (LRU) algorthm reference strng: Here, 9 faults. Reference strng: Counter mplementaton Every entry has a counter; every tme s referenced through ths entry, copy the clock nto the counter When a needs to be changed, look at the counters to determne whch are to change
14 LRU replacement LRU algorthm reference strng: Here, faults. Stack mplementaton keep a stack of numbers n a double lnk form: Page referenced: move t to the top requres 6 ponters to be changed No search for replacement General term: stack algorthms Have property that addng frames always reduces faults (no Belady s Anomaly) Use a stack to record most recent references Reference strng 7 LRU approxmaton algorthms Reference bt Wth each assocate a bt, ntally = When s referenced bt set to Replace a whch s (f one exsts) We do not know the order, however Second chance Need reference bt Clock replacement If to be replaced (n clock order) has reference bt = then: set reference bt leave n replace next (n clock order), subject to same rules 7 Second-chance (clock) replacement algorthm Second-chance (clock) replacement algorthm Next vctm ( clock hand ) Crcular queue of s Next vctm ( clock hand ) Crcular queue of s Reference bts Reference bts
15 Second-chance (clock) replacement algorthm Second-chance (clock) replacement algorthm Next vctm ( clock hand ) Crcular queue of s Next vctm ( clock hand ) Crcular queue of s Reference bts Reference bts Allocaton of frames Frame allocaton polces Each process needs mnmum number of s Example: IBM 7 6 s to handle SS MOVE nstructon: nstructon s 6 bytes, mght span s s to handle from s to handle to Two major allocaton schemes fxed allocaton prorty allocaton Fxed allocaton Prorty allocaton Equal allocaton all processes get equal share. Proportonal allocaton Allocate accordng to the sze of process Proportonal allocaton scheme Usng prortes rather than sze If process P generates a fault, select:. one of ts frames, or. frame from a process wth lower prorty s = szeof process p S = s m = total number of frames s a = allocaton for p = m S m = 6 s = s = 7 a = a = 6 9 7
16 Global vs. local allocaton Global replacement process selects a replacement frame from the set of all frames; one process can take a frame from another Local replacement each process selects from only ts own set of allocated frames Thrashng If a process does not have enough s, the fault rate s very hgh. Ths leads to: low CPU utlzaton operatng system thnks that t needs to ncrease the degree of multprogrammng another process added to the system Thrashng a process s busy swappng s n and out Thrashng Demand pagng and thrashng Useful CPU utlzaton Thrashng begns! Why does demand pagng work? Localty model Process mgrates from one localty to another Localtes may overlap Why does thrashng occur? Σ sze of localty > total sze Demand for vrtual (e.g., more procs) Localty n a reference pattern Workng-set model Δ workng-set wndow a fxed number of references Example:, nstructon WSS (workng set of Process P ) = total number of s referenced n the most recent Δ (vares n tme) Δ too small wll not encompass entre localty Δ too large wll encompass several localtes Δ = wll encompass entre program 6
17 Allocate demand frames D = Σ WSS total demand frames Intuton: how much s really needed Workng-set model Page reference strng: D > m Thrashng Polcy: f D > m, suspend some processes Workng-set model Workng-set model Page reference strng: Page reference strng: Δ Δ Δ WS(t ) = {,,,6,7} t WS(t ) = {,,,6,7} t WS(t ) = {,} t Keepng track of the workng set Approxmate wth nterval tmer + a reference bt Example: Δ =, Tmer nterrupts after every tme unts Keep n bts for each Whenever a tmer nterrupts shft+copy and sets the values of all reference bts to If one of the bts n = n workng set Why s ths not completely accurate? Hnt: Nyqust-Shannon! Keepng track of the workng set Approxmate wth nterval tmer + a reference bt Example: Δ =, Tmer nterrupts after every tme unts Keep n bts for each Whenever a tmer nterrupts shft+copy and sets the values of all reference bts to If one of the bts n = n workng set Why s ths not completely accurate? Improvement = bts and nterrupt every tme unts 7
18 Page-fault frequency scheme Establsh acceptable -fault rate If actual rate too low, process loses frame If actual rate too hgh, process gans frame Rate of faults Increase number of frames Upper bound Lower bound Number of frames Decrease number of frames 8
If you miss a key. Chapter 6: Demand Paging Source:
ADRIAN PERRIG & TORSTEN HOEFLER ( -6- ) Networks and Operatng Systems Chapter 6: Demand Pagng Source: http://redmne.replcant.us/projects/replcant/wk/samsunggalaxybackdoor If you mss a key after yesterday
More information#4 Inverted page table. The need for more bookkeeping. Inverted page table architecture. Today. Our Small Quiz
ADRIAN PERRIG & TORSTEN HOEFLER Networks and Operatng Systems (-6-) Chapter 6: Demand Pagng http://redmne.replcant.us/projects/replcant/wk/samsunggalaxybackdoor () # Inverted table One system-wde table
More informationVirtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory
Background EECS. Operatng System Fundamentals No. Vrtual Memory Prof. Hu Jang Department of Electrcal Engneerng and Computer Scence, York Unversty Memory-management methods normally requres the entre process
More informationChapter 6: Demand Paging
ADRIAN PERRIG & TORSTEN HOEFLER ( 5-006-00 ) Networks and Operating Systems Chapter 6: Demand Paging Source: http://redmine.replicant.us/projects/replicant/wiki/samsunggalaxybackdoor If you miss a key
More informationADRIAN PERRIG & TORSTEN HOEFLER Networks and Operating Systems ( ) Chapter 6: Demand Paging
ADRIAN PERRIG & TORSTEN HOEFLER Networks and Operating Systems (5-006-00) Chapter 6: Demand Paging http://redmine.replicant.us/projects/replicant/wiki/samsunggalaxybackdoor (0) # Inverted page table One
More informationELEC 377 Operating Systems. Week 6 Class 3
ELEC 377 Operatng Systems Week 6 Class 3 Last Class Memory Management Memory Pagng Pagng Structure ELEC 377 Operatng Systems Today Pagng Szes Vrtual Memory Concept Demand Pagng ELEC 377 Operatng Systems
More informationCache Performance 3/28/17. Agenda. Cache Abstraction and Metrics. Direct-Mapped Cache: Placement and Access
Agenda Cache Performance Samra Khan March 28, 217 Revew from last lecture Cache access Assocatvty Replacement Cache Performance Cache Abstracton and Metrcs Address Tag Store (s the address n the cache?
More informationChapter 9: Virtual Memory. Operating System Concepts 9 th Edition
Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationModule 9: Virtual Memory
Module 9: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing Other Considerations Demand Segmentation Operating
More informationModule 9: Virtual Memory
Module 9: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing Other Considerations Demand Segmenation 9.1 Background
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationPage Replacement. 3/9/07 CSE 30341: Operating Systems Principles
Page Replacement page 1 Page Replacement Algorithms Want lowest page-fault rate Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number
More informationChapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition
Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationBackground. Demand Paging. valid-invalid bit. Tevfik Koşar. CSC Operating Systems Spring 2007
CSC 0 - Operating Systems Spring 007 Lecture - XIII Virtual Memory Tevfik Koşar Background Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in
More informationNachos Project 3. Speaker: Sheng-Wei Cheng 2010/12/16
Nachos Project Speaker: Sheng-We Cheng //6 Agenda Motvaton User Programs n Nachos Related Nachos Code for User Programs Project Assgnment Bonus Submsson Agenda Motvaton User Programs n Nachos Related Nachos
More informationBackground. Virtual Memory (2/2) Demand Paging Example. First-In-First-Out (FIFO) Algorithm. Page Replacement Algorithms. Performance of Demand Paging
Virtual Memory (/) Background Page Replacement Allocation of Frames Thrashing Background Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in memory
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations
More informationChapter 8: Virtual Memory. Operating System Concepts
Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Background Demand Paging Chapter 9: Virtual Memory Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations
More informationDemand Paging. Valid-Invalid Bit. Steps in Handling a Page Fault. Page Fault. Transfer of a Paged Memory to Contiguous Disk Space
Demand Paging Transfer of a Paged Memory to Contiguous Disk Space Bring a page into memory only when it is needed. Less I/O needed Less memory needed Faster response More users Page is needed reference
More information4/11/17. Agenda. Princeton University Computer Science 217: Introduction to Programming Systems. Goals of this Lecture. Storage Management.
//7 Prnceton Unversty Computer Scence 7: Introducton to Programmng Systems Goals of ths Lecture Storage Management Help you learn about: Localty and cachng Typcal storage herarchy Vrtual memory How the
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Chapter 9: Virtual Memory 9.1 Background 9.2 Demand Paging 9.3 Copy-on-Write 9.4 Page Replacement 9.5 Allocation of Frames 9.6 Thrashing 9.7 Memory-Mapped Files 9.8 Allocating
More informationChapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space
Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations
More informationChapter 10: Virtual Memory. Background
Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples 10.1 Background Virtual memory separation of user logical
More informationChapter 9: Virtual-Memory
Chapter 9: Virtual-Memory Management Chapter 9: Virtual-Memory Management Background Demand Paging Page Replacement Allocation of Frames Thrashing Other Considerations Silberschatz, Galvin and Gagne 2013
More informationChapter 9: Virtual-Memory Management. Operating System Concepts 8 th Edition,
Chapter 9: Virtual-Memory Management, Silberschatz, Galvin and Gagne 2009 Chapter 9: Virtual-Memory Management Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped
More informationOperating System Concepts
Chapter 9: Virtual-Memory Management 9.1 Silberschatz, Galvin and Gagne 2005 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped
More informationChapter 10: Virtual Memory. Background. Demand Paging. Valid-Invalid Bit. Virtual Memory That is Larger Than Physical Memory
Chapter 0: Virtual Memory Background Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples Virtual memory separation of user logical memory
More informationOPERATING SYSTEM. Chapter 9: Virtual Memory
OPERATING SYSTEM Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory
More informationOptimal Algorithm. Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs
Optimal Algorithm Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs page 1 Least Recently Used (LRU) Algorithm Reference string: 1, 2, 3,
More informationVirtual Memory. CSCI 315 Operating Systems Design Department of Computer Science
Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture were based on those Operating Systems Concepts, 9th ed., by Silberschatz, Galvin, and
More informationWhere are we in the course?
Previous Lectures Memory Management Approaches Allocate contiguous memory for the whole process Use paging (map fixed size logical pages to physical frames) Use segmentation (user s view of address space
More informationChapter 3: Virtual Memory ว ตถ ประสงค. Background สามารถอธ บายข อด ในการท ระบบใช ว ธ การจ ดการหน วยความจ าแบบเสม อนได
Chapter 9: Virtual Memory Chapter 3: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations
More informationVirtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory
TDIU Operating systems Overview: Virtual Memory Virtual Memory Background Demand Paging Page Replacement Allocation of Frames Thrashing and Data Access Locality [SGG7/8/9] Chapter 9 Copyright Notice: The
More informationCS420: Operating Systems
Virtual Memory James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Background Code needs to be in memory
More informationChapter 9: Virtual Memory. Operating System Concepts 9 th Edition
Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationCS307: Operating Systems
CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn
More informationChapter 5: Memory Management
ADRIAN PERRIG & TORSTEN HOEFLER ( 252-0062-00 ) Networks and Operating Systems Chapter 5: Memory Management http://support.apple.com/kb/ht562 Description: The ios kernel has checks to validate that the
More informationVirtual Memory Outline
Virtual Memory Outline Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations Operating-System Examples
More informationCSE 120. Translation Lookaside Buffer (TLB) Implemented in Hardware. July 18, Day 5 Memory. Instructor: Neil Rhodes. Software TLB Management
CSE 120 July 18, 2006 Day 5 Memory Instructor: Neil Rhodes Translation Lookaside Buffer (TLB) Implemented in Hardware Cache to map virtual page numbers to page frame Associative memory: HW looks up in
More informationVirtual Memory COMPSCI 386
Virtual Memory COMPSCI 386 Motivation An instruction to be executed must be in physical memory, but there may not be enough space for all ready processes. Typically the entire program is not needed. Exception
More informationChapter 9: Virtual Memory. Operating System Concepts 9th Edition
Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations
More informationVirtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory. Demand Paging
TDDB68 Concurrent programming and operating systems Overview: Virtual Memory Virtual Memory [SGG7/8] Chapter 9 Background Demand Paging Page Replacement Allocation of Frames Thrashing and Data Access Locality
More informationChapter 10: Virtual Memory
Chapter 10: Virtual Memory Chapter 10: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations
More informationVirtual Memory. Virtual Memory. Demand Paging. valid-invalid bit. Virtual Memory Larger than Physical Memory
Virtual Memory Virtual Memory CSCI Operating Systems Design Department of Computer Science Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in
More informationPAGE REPLACEMENT. Operating Systems 2015 Spring by Euiseong Seo
PAGE REPLACEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics What if the physical memory becomes full? Page replacement algorithms How to manage memory among competing processes? Advanced
More informationOperating System Concepts 9 th Edition
Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationVIRTUAL MEMORY READING: CHAPTER 9
VIRTUAL MEMORY READING: CHAPTER 9 9 MEMORY HIERARCHY Core! Processor! Core! Caching! Main! Memory! (DRAM)!! Caching!! Secondary Storage (SSD)!!!! Secondary Storage (Disk)! L cache exclusive to a single
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L20 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions from last time Page
More informationVirtual Memory III. Jo, Heeseung
Virtual Memory III Jo, Heeseung Today's Topics What if the physical memory becomes full? Page replacement algorithms How to manage memory among competing processes? Advanced virtual memory techniques Shared
More informationMemory and I/O Organization
Memory and I/O Organzaton 8-1 Prncple of Localty Localty small proporton of memory accounts for most run tme Rule of thumb For 9% of run tme next nstructon/data wll come from 1% of program/data closest
More informationBasic Memory Management
Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it
More informationEfficient Distributed File System (EDFS)
Effcent Dstrbuted Fle System (EDFS) (Sem-Centralzed) Debessay(Debsh) Fesehaye, Rahul Malk & Klara Naherstedt Unversty of Illnos-Urbana Champagn Contents Problem Statement, Related Work, EDFS Desgn Rate
More informationReal-Time Guarantees. Traffic Characteristics. Flow Control
Real-Tme Guarantees Requrements on RT communcaton protocols: delay (response s) small jtter small throughput hgh error detecton at recever (and sender) small error detecton latency no thrashng under peak
More informationCompiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz
Compler Desgn Sprng 2014 Regster Allocaton Sample Exercses and Solutons Prof. Pedro C. Dnz USC / Informaton Scences Insttute 4676 Admralty Way, Sute 1001 Marna del Rey, Calforna 90292 pedro@s.edu Regster
More informationCS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement"
CS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement" October 3, 2012 Ion Stoica http://inst.eecs.berkeley.edu/~cs162 Lecture 9 Followup: Inverted Page Table" With
More informationAn Efficient Garbage Collection for Flash Memory-Based Virtual Memory Systems
S. J and D. Shn: An Effcent Garbage Collecton for Flash Memory-Based Vrtual Memory Systems 2355 An Effcent Garbage Collecton for Flash Memory-Based Vrtual Memory Systems Seunggu J and Dongkun Shn, Member,
More informationBasic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1
Basic Memory Management Program must be brought into memory and placed within a process for it to be run Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester Mono-programming
More informationVirtual Memory. CSCI 315 Operating Systems Design Department of Computer Science
Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating
More informationMemory Management. Virtual Memory. By : Kaushik Vaghani. Prepared By : Kaushik Vaghani
Memory Management Virtual Memory By : Kaushik Vaghani Virtual Memory Background Page Fault Dirty Page / Dirty Bit Demand Paging Copy-on-Write Page Replacement Objectives To describe the benefits of a virtual
More informationPrinciples of Operating Systems
Principles of Operating Systems Lecture 21-23 - Virtual Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian,
More informationPage Replacement Algorithms
Page Replacement Algorithms MIN, OPT (optimal) RANDOM evict random page FIFO (first-in, first-out) give every page equal residency LRU (least-recently used) MRU (most-recently used) 1 9.1 Silberschatz,
More informationAssembler. Building a Modern Computer From First Principles.
Assembler Buldng a Modern Computer From Frst Prncples www.nand2tetrs.org Elements of Computng Systems, Nsan & Schocken, MIT Press, www.nand2tetrs.org, Chapter 6: Assembler slde Where we are at: Human Thought
More informationSwapping. Operating Systems I. Swapping. Motivation. Paging Implementation. Demand Paging. Active processes use more physical memory than system has
Swapping Active processes use more physical memory than system has Operating Systems I Address Binding can be fixed or relocatable at runtime Swap out P P Virtual Memory OS Backing Store (Swap Space) Main
More informationBasic Page Replacement
Basic Page Replacement 1. Find the location of the desired page on disk 2. Find a free frame: - If there is a free frame, use it - If there is no free frame, use a page replacement algorithm to select
More informationMemory Management. To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time.
Memory Management To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time. Basic CPUs and Physical Memory CPU cache Physical memory
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Demand Segmentation Operating System Examples 9.2 Background
More informationMemory Management. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University
Memory Management Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Topics Why is memory management difficult? Old memory management techniques: Fixed
More informationVirtual Memory Management
Virtual Memory Management CS-3013 Operating Systems Hugh C. Lauer (Slides include materials from Slides include materials from Modern Operating Systems, 3 rd ed., by Andrew Tanenbaum and from Operating
More information현재이이미지를표시할수없습니다. Chapter 9: Virtual Memory
현재이이미지를표시할수없습니다. Chapter 9: Virtual Memory Objectives To describe the benefits of a virtual memory system To explain the concepts of demand paging, page-replacement algorithms, and allocation of page frames
More informationCSE 4/521 Introduction to Operating Systems. Lecture 15 Virtual Memory I (Background, Demand Paging) Summer 2018
CSE 4/521 Introduction to Operating Systems Lecture 15 Virtual Memory I (Background, Demand Paging) Summer 2018 Overview Objective: To describe the benefits of a virtual memory system. To explain the concept
More informationSignal types (some of them) Networks and Operating Systems ( ) Chapter 5: Memory Management. Where do signals come from?
ADRIAN PERRIG & TORSTEN HOEFLER Networks and Operating Systems (5-006-00) Chapter 5: Memory Management http://support.apple.com/kb/ht56 (Jul. 05) Description: The ios kernel has checks to validate that
More informationkccvoip.com basic voip training NAT/PAT extract 2008
kccvop.com basc vop tranng NAT/PAT extract 28 As we have seen n the prevous sldes, SIP and H2 both use addressng nsde ther packets to rely nformaton. Thnk of an envelope where we place the addresses of
More informationOperating Systems. Operating Systems Sina Meraji U of T
Operating Systems Operating Systems Sina Meraji U of T Recap Last time we looked at memory management techniques Fixed partitioning Dynamic partitioning Paging Example Address Translation Suppose addresses
More informationinstruction is 6 bytes, might span 2 pages 2 pages to handle from 2 pages to handle to Two major allocation schemes
Allocation of Frames How should the OS distribute the frames among the various processes? Each process needs minimum number of pages - at least the minimum number of pages required for a single assembly
More informationHow to create a process? What does process look like?
How to create a process? On Unix systems, executable read by loader Compile time runtime Ken Birman ld loader Cache Compiler: generates one object file per source file Linker: combines all object files
More informationChapter 4 Memory Management
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms 4.6 Design issues for paging systems 4.7
More informationCSE 451: Operating Systems Winter Page Table Management, TLBs and Other Pragmatics. Gary Kimura
CSE 451: Operating Systems Winter 2013 Page Table Management, TLBs and Other Pragmatics Gary Kimura Moving now from Hardware to how the OS manages memory Two main areas to discuss Page table management,
More informationMemory management, part 2: outline
Memory management, part 2: outline Page replacement algorithms Modeling PR algorithms o Working-set model and algorithms Virtual memory implementation issues 1 Page Replacement Algorithms Page fault forces
More informationFirst-In-First-Out (FIFO) Algorithm
First-In-First-Out (FIFO) Algorithm Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 3 frames (3 pages can be in memory at a time per process) 15 page faults Can vary by reference string:
More informationTopics: Virtual Memory (SGG, Chapter 09) CS 3733 Operating Systems
Topics: Virtual Memory (SGG, Chapter 09) 9.1-9.7 CS 3733 Operating Systems Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio Office: NPB 3.330 Phone: (210)
More informationProblem Set 3 Solutions
Introducton to Algorthms October 4, 2002 Massachusetts Insttute of Technology 6046J/18410J Professors Erk Demane and Shaf Goldwasser Handout 14 Problem Set 3 Solutons (Exercses were not to be turned n,
More informationVirtual Memory. 1 Administrivia. Tom Kelliher, CS 240. May. 1, Announcements. Homework, toolboxes due Friday. Assignment.
Virtual Memory Tom Kelliher, CS 240 May. 1, 2002 1 Administrivia Announcements Homework, toolboxes due Friday. Assignment From Last Time Introduction to caches. Outline 1. Virtual memory. 2. System support:
More informationMemory management, part 2: outline. Operating Systems, 2017, Danny Hendler and Amnon Meisels
Memory management, part 2: outline 1 Page Replacement Algorithms Page fault forces choice o which page must be removed to make room for incoming page? Modified page must first be saved o unmodified just
More informationLecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne
Lecture 17 Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne Page Replacement Algorithms Last Lecture: FIFO Optimal Page Replacement LRU LRU Approximation Additional-Reference-Bits
More informationCS 5523 Operating Systems: Memory Management (SGG-8)
CS 5523 Operating Systems: Memory Management (SGG-8) Instructor: Dr Tongping Liu Thank Dr Dakai Zhu, Dr Palden Lama, and Dr Tim Richards (UMASS) for providing their slides Outline Simple memory management:
More informationLecture 12: Demand Paging
Lecture 1: Demand Paging CSE 10: Principles of Operating Systems Alex C. Snoeren HW 3 Due 11/9 Complete Address Translation We started this topic with the high-level problem of translating virtual addresses
More informationCE 221 Data Structures and Algorithms
CE 1 ata Structures and Algorthms Chapter 4: Trees BST Text: Read Wess, 4.3 Izmr Unversty of Economcs 1 The Search Tree AT Bnary Search Trees An mportant applcaton of bnary trees s n searchng. Let us assume
More informationMemory Management. Disclaimer: some slides are adopted from book authors slides with permission 1
Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Paged MMU: Two main Issues Translation speed can be slow TLB Table size is big Multi-level page table
More informationChapter 8: Main Memory. Operating System Concepts 8th Edition
Chapter 8: Main Memory Operating System Concepts 8th Edition Silberschatz, Galvin and Gagne 2009 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page
More informationMove back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t
Memory Management Ch. 3 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Memory Hierarchy Cache CPU Main Swap Area Memory
More informationMemory Management Ch. 3
Memory Management Ch. 3 Ë ¾¾ Ì Ï ÒÒØ Å ÔÔ ÓÐÐ 1 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Ë ¾¾ Ì Ï ÒÒØ Å ÔÔ ÓÐÐ
More informationCS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University
Frequently asked questions from the previous class survey CS : OPERATNG SYSTEMS [VRTUAL MEMORY] Shrideep Pallickara Computer Science Colorado State University Multi-level paging: How many levels deep?
More informationCSC Operating Systems Spring Lecture - XIV Virtual Memory - II. Tevfik Ko!ar. Louisiana State University. March 27 th, 2008.
CSC 0 - Operating Systems Spring 008 Lecture - XIV Virtual Memory - II Tevfik Ko!ar Louisiana State University March 7 th, 008 Background Virtual memory separation of user logical memory from physical
More informationEven in those cases where the entire program is needed, it may not all be needed at the same time (such is the case with overlays, for example).
Chapter 10 VIRTUAL MEMORY In Chapter 9, we discussed various memory-management strategies used in computer systems. All these strategies have the same goal: to keep many processes in memory simultaneously
More informationSome material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier
Some materal adapted from Mohamed Youns, UMBC CMSC 611 Spr 2003 course sldes Some materal adapted from Hennessy & Patterson / 2003 Elsever Scence Performance = 1 Executon tme Speedup = Performance (B)
More informationMemory Management. Disclaimer: some slides are adopted from book authors slides with permission 1
Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Demand paging Concepts to Learn 2 Abstraction Virtual Memory (VM) 4GB linear address space for each process
More informationOperating Systems Virtual Memory. Lecture 11 Michael O Boyle
Operating Systems Virtual Memory Lecture 11 Michael O Boyle 1 Paged virtual memory Allows a larger logical address space than physical memory All pages of address space do not need to be in memory the
More informationMemory Management Outline. Operating Systems. Motivation. Paging Implementation. Accessing Invalid Pages. Performance of Demand Paging
Memory Management Outline Operating Systems Processes (done) Memory Management Basic (done) Paging (done) Virtual memory Virtual Memory (Chapter.) Motivation Logical address space larger than physical
More informationChapters 9 & 10: Memory Management and Virtual Memory
Chapters 9 & 10: Memory Management and Virtual Memory Important concepts (for final, projects, papers) addressing: physical/absolute, logical/relative/virtual overlays swapping and paging memory protection
More information