SlideShare a Scribd company logo
1 of 25
Virtual Memory Management
Demand paging
Mrs.T.Jeya Asst.professor, Dept of CS
Background
 Virtual memory – separation of user logical
memory from physical memory:
 Only part of the program needs to be in memory for
execution.
 Logical address space can therefore be much larger
than physical address space.
 Allows address spaces to be shared by several
processes.
 Allows for more efficient process creation.
 More programs running concurrently.
 Less I/O needed to load or swap processes.
Virtual Memory Components
A. Frank - P. Weisberg
Background
 Virtual address space – logical view of how
process is stored in memory:
 Usually start at address 0, contiguous addresses until
end
of space.
 Meanwhile, physical memory organized in page
frames.
 MMU must map logical to physical.
 Virtual memory can be implemented via:
 Demand paging
 Demand segmentation
Virtual Memory Example
Virtual Memory that is larger than Physical Memory
Advantages of Partial Loading
 More processes can be maintained in main
memory:
 only load in some of the pieces of each process.
 with more processes in main memory, it is more
likely that a process will be in the Ready state at
any given time.
 A process can now execute even if it is larger
than the main memory size:
 it is even possible to use more bits for logical
addresses than the bits needed for addressing the
physical memory.
Virtual Memory Addressing
A. Frank - P. Weisberg
Virtual-address Space
 Usually design logical address space for stack to start
at Max logical address and grow “down” while heap
grows “up”:
 Maximizes address space use.
 Unused address space between the two is hole.
 No physical memory needed until heap or stack
grows to a given new page.
 Enables sparse address spaces with holes left for
growth, dynamically linked libraries, etc.
 System libraries shared via mapping into virtual
address space.
 Shared memory by mapping pages read-write into
virtual address space.
 Pages can be shared during fork(), speeding
process creation.
Shared Library using Virtual Memory
Demand Paging
 Bring a page into memory only when it is
needed:
 Less I/O needed, no unnecessary I/O
 Less memory needed
 Faster response
 More users
 Page is needed  reference to it:
 invalid reference  abort
 not-in-memory  bring to memory
 Similar to paging system with swapping.
 Lazy swapper – never swaps a page into
memory unless page will be needed; Swapper
that deals with pages is a pager.
Basic Concepts
 With swapping, pager guesses which pages will be
used before swapping out again.
 Instead, pager brings in only those pages into
memory.
 How to determine that set of pages?
 Need new MMU functionality to implement demand paging.
 If pages needed are already memory resident:
 No difference from non demand-paging.
 If page needed and not memory resident:
 Need to detect and load the page into memory from storage:
○ Without changing program behavior.
○ Without programmer needing to change code.
Valid-Invalid Bit
 With each page table entry, a valid–invalid (present-absent) bit is
associated
(v  in-memory, i  not-in-memory).
 Initially valid–invalid bit is set to i on all entries.
 Example of a page table snapshot:
During address translation, if valid–invalid bit in page table entry
is i  page fault.
v
v
v
v
i
i
i
….
Frame # valid-invalid bit
Virtual Memory Mapping Example
Page Table when some
Pages are not in Main Memory
Dynamics of Demand Paging
 Each page table entry contains a present (valid-
invalid) bit to indicate whether the page is in main
memory or not.
 If it is in main memory, the entry contains the frame
number of the corresponding page in main memory.
 If it is not in main memory, the entry may contain the
address of that page on disk or the page number may
be used to index another table (often in the PCB) to
obtain the address of that page on disk.
• Typically, each process has its own page table.
Need For Page Fault/Replacement
Steps in handling a Page Fault
Steps in handling a Page Replacement (1)
Aspects of Demand Paging
 Extreme case – start process with no pages in memory:
 OS sets instruction pointer to first instruction of process,
non-memory-resident -> page fault.
 And for every other process pages on first access.
 This is Pure demand paging.
 Actually, a given instruction could access multiple pages -
> multiple page faults:
 Consider fetch and decode of instruction which adds 2 numbers
from memory and stores result back to memory.
 Pain decreased because of locality of reference.
 Hardware support needed for demand paging:
 Page table with valid/invalid bit.
 Secondary memory (swap device with swap space).
 Instruction restart.
Instruction Restart
 Consider an instruction that could access
several different locations:
 block move
 auto increment/decrement location
 Restart the whole operation?
○ What if source and destination overlap?
Address Translation in a Paging System
Backing/Swap Store
(a) Paging to static swap area. (b) Backing up pages dynamically.
Performance of Demand Paging
 Three major activities:
 Service the interrupt – careful coding means just several hundred
instructions needed.
 Read the page – lots of time..
 Restart the process – again just a small amount of time
 Page Fault Rate 0  p  1
 if p = 0, no page faults.
 if p = 1, every reference is a fault.
 Effective Access Time (EAT) –
EAT = (1 – p) x memory access
+ p x (page fault overhead
+ [swap page out]
+ swap page in
+ restart overhead)
Demand Paging Example
 Memory access time = 200 nanoseconds.
 Average page-fault service time = 8 milliseconds.
 EAT = (1 – p) x 200 + p (8 milliseconds)
= (1 – p) x 200 + p x 8,000,000
= 200 + p x 7,999,800
 If one access out of 1,000 causes a page fault, then
EAT = 8.2 microseconds.
This is a slowdown by a factor of 40!!
 If want performance degradation < 10 percent
 220 > 200 + 7,999,800 x p
20 > 7,999,800 x p
 p < .0000025
 < one page fault in every 400,000 memory accesses.

More Related Content

What's hot (20)

Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
BANKER'S ALGORITHM
BANKER'S ALGORITHMBANKER'S ALGORITHM
BANKER'S ALGORITHM
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Storage Management
Storage ManagementStorage Management
Storage Management
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Memory management
Memory managementMemory management
Memory management
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Memory management
Memory managementMemory management
Memory management
 
Deadlock- Operating System
Deadlock- Operating SystemDeadlock- Operating System
Deadlock- Operating System
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Cache coherence ppt
Cache coherence pptCache coherence ppt
Cache coherence ppt
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 

Similar to Virtual memory - Demand Paging

Mca ii os u-4 memory management
Mca  ii  os u-4 memory managementMca  ii  os u-4 memory management
Mca ii os u-4 memory managementRai University
 
Virtual Memory Management
Virtual Memory ManagementVirtual Memory Management
Virtual Memory ManagementRahul Jamwal
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858marangburu42
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinalmarangburu42
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Virtual memory pre-final-formatting
Virtual memory pre-final-formattingVirtual memory pre-final-formatting
Virtual memory pre-final-formattingmarangburu42
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OSC.U
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt completeKalai Selvi
 
Virtual memory This is the operating system ppt.ppt
Virtual memory This is the operating system ppt.pptVirtual memory This is the operating system ppt.ppt
Virtual memory This is the operating system ppt.pptry54321288
 
Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904marangburu42
 
Inverted page tables basic
Inverted page tables basicInverted page tables basic
Inverted page tables basicSanoj Kumar
 

Similar to Virtual memory - Demand Paging (20)

Mca ii os u-4 memory management
Mca  ii  os u-4 memory managementMca  ii  os u-4 memory management
Mca ii os u-4 memory management
 
Virtual Memory Management
Virtual Memory ManagementVirtual Memory Management
Virtual Memory Management
 
CH09.pdf
CH09.pdfCH09.pdf
CH09.pdf
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinal
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Virtual memory pre-final-formatting
Virtual memory pre-final-formattingVirtual memory pre-final-formatting
Virtual memory pre-final-formatting
 
OSCh10
OSCh10OSCh10
OSCh10
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OS
 
OS_Ch10
OS_Ch10OS_Ch10
OS_Ch10
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 
Mem mgt
Mem mgtMem mgt
Mem mgt
 
Virtual memory This is the operating system ppt.ppt
Virtual memory This is the operating system ppt.pptVirtual memory This is the operating system ppt.ppt
Virtual memory This is the operating system ppt.ppt
 
Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904
 
Ch09
Ch09Ch09
Ch09
 
Module4
Module4Module4
Module4
 
Operating System
Operating SystemOperating System
Operating System
 
Inverted page tables basic
Inverted page tables basicInverted page tables basic
Inverted page tables basic
 

Recently uploaded

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

Virtual memory - Demand Paging

  • 1. Virtual Memory Management Demand paging Mrs.T.Jeya Asst.professor, Dept of CS
  • 2. Background  Virtual memory – separation of user logical memory from physical memory:  Only part of the program needs to be in memory for execution.  Logical address space can therefore be much larger than physical address space.  Allows address spaces to be shared by several processes.  Allows for more efficient process creation.  More programs running concurrently.  Less I/O needed to load or swap processes.
  • 3. Virtual Memory Components A. Frank - P. Weisberg
  • 4. Background  Virtual address space – logical view of how process is stored in memory:  Usually start at address 0, contiguous addresses until end of space.  Meanwhile, physical memory organized in page frames.  MMU must map logical to physical.  Virtual memory can be implemented via:  Demand paging  Demand segmentation
  • 6. Virtual Memory that is larger than Physical Memory
  • 7. Advantages of Partial Loading  More processes can be maintained in main memory:  only load in some of the pieces of each process.  with more processes in main memory, it is more likely that a process will be in the Ready state at any given time.  A process can now execute even if it is larger than the main memory size:  it is even possible to use more bits for logical addresses than the bits needed for addressing the physical memory.
  • 8. Virtual Memory Addressing A. Frank - P. Weisberg
  • 9. Virtual-address Space  Usually design logical address space for stack to start at Max logical address and grow “down” while heap grows “up”:  Maximizes address space use.  Unused address space between the two is hole.  No physical memory needed until heap or stack grows to a given new page.  Enables sparse address spaces with holes left for growth, dynamically linked libraries, etc.  System libraries shared via mapping into virtual address space.  Shared memory by mapping pages read-write into virtual address space.  Pages can be shared during fork(), speeding process creation.
  • 10. Shared Library using Virtual Memory
  • 11. Demand Paging  Bring a page into memory only when it is needed:  Less I/O needed, no unnecessary I/O  Less memory needed  Faster response  More users  Page is needed  reference to it:  invalid reference  abort  not-in-memory  bring to memory  Similar to paging system with swapping.  Lazy swapper – never swaps a page into memory unless page will be needed; Swapper that deals with pages is a pager.
  • 12. Basic Concepts  With swapping, pager guesses which pages will be used before swapping out again.  Instead, pager brings in only those pages into memory.  How to determine that set of pages?  Need new MMU functionality to implement demand paging.  If pages needed are already memory resident:  No difference from non demand-paging.  If page needed and not memory resident:  Need to detect and load the page into memory from storage: ○ Without changing program behavior. ○ Without programmer needing to change code.
  • 13. Valid-Invalid Bit  With each page table entry, a valid–invalid (present-absent) bit is associated (v  in-memory, i  not-in-memory).  Initially valid–invalid bit is set to i on all entries.  Example of a page table snapshot: During address translation, if valid–invalid bit in page table entry is i  page fault. v v v v i i i …. Frame # valid-invalid bit
  • 15. Page Table when some Pages are not in Main Memory
  • 16. Dynamics of Demand Paging  Each page table entry contains a present (valid- invalid) bit to indicate whether the page is in main memory or not.  If it is in main memory, the entry contains the frame number of the corresponding page in main memory.  If it is not in main memory, the entry may contain the address of that page on disk or the page number may be used to index another table (often in the PCB) to obtain the address of that page on disk. • Typically, each process has its own page table.
  • 17. Need For Page Fault/Replacement
  • 18. Steps in handling a Page Fault
  • 19. Steps in handling a Page Replacement (1)
  • 20. Aspects of Demand Paging  Extreme case – start process with no pages in memory:  OS sets instruction pointer to first instruction of process, non-memory-resident -> page fault.  And for every other process pages on first access.  This is Pure demand paging.  Actually, a given instruction could access multiple pages - > multiple page faults:  Consider fetch and decode of instruction which adds 2 numbers from memory and stores result back to memory.  Pain decreased because of locality of reference.  Hardware support needed for demand paging:  Page table with valid/invalid bit.  Secondary memory (swap device with swap space).  Instruction restart.
  • 21. Instruction Restart  Consider an instruction that could access several different locations:  block move  auto increment/decrement location  Restart the whole operation? ○ What if source and destination overlap?
  • 22. Address Translation in a Paging System
  • 23. Backing/Swap Store (a) Paging to static swap area. (b) Backing up pages dynamically.
  • 24. Performance of Demand Paging  Three major activities:  Service the interrupt – careful coding means just several hundred instructions needed.  Read the page – lots of time..  Restart the process – again just a small amount of time  Page Fault Rate 0  p  1  if p = 0, no page faults.  if p = 1, every reference is a fault.  Effective Access Time (EAT) – EAT = (1 – p) x memory access + p x (page fault overhead + [swap page out] + swap page in + restart overhead)
  • 25. Demand Paging Example  Memory access time = 200 nanoseconds.  Average page-fault service time = 8 milliseconds.  EAT = (1 – p) x 200 + p (8 milliseconds) = (1 – p) x 200 + p x 8,000,000 = 200 + p x 7,999,800  If one access out of 1,000 causes a page fault, then EAT = 8.2 microseconds. This is a slowdown by a factor of 40!!  If want performance degradation < 10 percent  220 > 200 + 7,999,800 x p 20 > 7,999,800 x p  p < .0000025  < one page fault in every 400,000 memory accesses.