SlideShare uma empresa Scribd logo
1 de 42
Principles  of  Virtual Memory Virtual Memory, Paging, Segmentation
Overview ,[object Object],[object Object],[object Object]
1. Virtual Memory ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
1.1 Why Virtual Memory (VM)? ,[object Object],[object Object],OS Process 3 Process 1 Process 2 Process 4 Memory ,[object Object],[object Object],[object Object],[object Object],[object Object]
1.2 What  i s VM? ,[object Object],[object Object],[object Object],[object Object],Virtual   Memory Physical   Memory Virtual  Address Physical  Address „ Piece“ of Virtual Memory „ Piece“ of Physical Memory Note:  It does not matter at which physical address a „piece“ of VM is placed, since the corresponding addresses are mapped by the mapping unit. 0xA0F4 0xC0F4 Mapping Unit (MMU) Table (one per Process)
1.3 The Mapping Process ,[object Object],virtual address check using mapping table ,[object Object],[object Object],[object Object],MMU piece in physical memory? memory access fault OS brings „ piece“ in from HDD physical address OS adjusts mapping table translate address yes
1.4 VM: Features Swapping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],lack of memory no need to swap out complete process!!! find rarely used  „piece" adjust mapping table „ piece“ modified? save  HDD location of „piece“ discard „ piece“ no write  „piece“ out  to disk yes
1.4 VM: Features Protection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
1.4 VM: Features Sharing ,[object Object],[object Object],[object Object],[object Object],shared memory P iece  2 P iece  1 Virtual memory Process 1 P iece  0 Piece   1 Piece   2 Piece   0 Physical  memory Virtual memory Process 2 P iece   1 P iece   0 P iece   2
1.5 VM: Advantages (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],1.5 VM: Advantages (2)
1.6 VM: Disadvantages ,[object Object],[object Object],[object Object]
1.7 VM: Implementation ,[object Object],[object Object],[object Object],[object Object]
2. Paging ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Valid-Invalid Bit ,[object Object],[object Object],[object Object],v v v v i i i … . Frame # valid-invalid bit page table
2.1 What  i s Paging? Page 7 Page 5 Page 4 Page 3 Page 2 Page 1 Page 6 Virtual memory (divided into equal  size pages) Page 0 0x00 Page Table (one per process, one entry per page   maintained by OS) Page 7 Page 5 Page 4 Page 3 Page 2 Page 1 Page 6 Page 0 v v v Frame 0 Frame 1 Frame 3 Frame 0 Frame 1 Frame 2 Frame 3 Physical memory (divided into  equal   size page frames) 0x00 v v v
2.2 Paging: Implementation   Typical Page Table Entry other Page Frame # execute x write w read r r w x valid v r w x v referenced re v re modified m re m shared s m s caching disabled c s c super - page su c su process id pid su pid guard data (extended) guard gd g pid g gd g gd other
2.2 Paging: Implementation Singlelevel Page Tables Problem:   Page tables can get  very large , e.g. 32 bit address space, 4KB pages     2^20 entries  per process     4MB at 4B per entry 64 bit    16777216 GB page table!!!! one entry per page one table per process 0x14 0x 2 Virtual address Page # Offset Physical address 0x14 Offset 0x8 Frame # Page Table Base Register (PTBR) Page Table 0x8 ... 0x0 * L 0x1 * L 0x2 * L L : size of entry
2.2 Paging: Implementation Multilevel Page Tables not all need be present saves memory table size can be restricted to one page Offset Page #1 Page #2 Page #3 Page Directory Page Middle Directory Page Table Page Frame # Offset Offset Frame # Oversized Super -P age v=0
Page Fault ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Steps in Handling a Page Fault
2. 3 Paging: Features Prepaging ,[object Object],[object Object],[object Object],VM referenced by process prepaged by OS
2. 3 Paging: Features Demand Paging ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
2. 3 Paging: Features Simplified Swapping ,[object Object],[object Object],Swapping out the 3 most seldomly used „pieces“ will not work     Swap algo must try to create free pieces as big as possible (costly!) rarely used Process requires memory Paging VM system Non-Paging VM system 1 „piece“ 3 pages PM PM
2. 4  Paging :  Advantages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
2. 5  Paging :  Disadvantages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Translation Lookaside Buffer ,[object Object],[object Object],[object Object],[object Object],[object Object]
Translation Lookaside Buffer ,[object Object],[object Object]
Translation Lookaside Buffer ,[object Object],[object Object],[object Object]
Translation Lookaside Buffer ,[object Object],[object Object],[object Object]
2. 6  Summary: Conversion  o f a  Virtual Address Virtual  address Physical address OS Hard ware no protection fault reference legal? copy on  write? HDD I/O  complete: interrupt memory full? update page table process into ready state copy page process into blocking state yes page fault no exception  to process no TLB page table miss page in mem? hit access rights? yes update TLB yes exception  to process no swap out a page yes HDD I/O  read req. no yes bring in page from HDD ! process into blocking state
5.  Virtual memory   a nd Linux ,[object Object],[object Object],[object Object],[object Object]
5.1 Why VM under Linux? ,[object Object],[object Object],[object Object],[object Object],[object Object]
5.2 The Linux VM System ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
5.3 The Linux Protection Scheme ,[object Object],[object Object],[object Object],[object Object],[object Object]
5.4 The Linux Paging System ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Windows Paging Policy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Virtual-address Space
Shared Library Using Virtual Memory
Caches ,[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Hardware Caches
Linux Page Tables ,[object Object]

Mais conteúdo relacionado

Mais procurados

Process Address Space: The way to create virtual address (page table) of user...
Process Address Space: The way to create virtual address (page table) of user...Process Address Space: The way to create virtual address (page table) of user...
Process Address Space: The way to create virtual address (page table) of user...Adrian Huang
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Slab Allocator in Linux Kernel
Slab Allocator in Linux KernelSlab Allocator in Linux Kernel
Slab Allocator in Linux KernelAdrian Huang
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBshimosawa
 
Linux Performance Tunning Memory
Linux Performance Tunning MemoryLinux Performance Tunning Memory
Linux Performance Tunning MemoryShay Cohen
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernelAdrian Huang
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421Linaro
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in LinuxAdrian Huang
 
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionLinux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionGene Chang
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsQUONTRASOLUTIONS
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmssangrampatil81
 
Physical Memory Models.pdf
Physical Memory Models.pdfPhysical Memory Models.pdf
Physical Memory Models.pdfAdrian Huang
 
Process Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelProcess Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelHaifeng Li
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 

Mais procurados (20)

Process Address Space: The way to create virtual address (page table) of user...
Process Address Space: The way to create virtual address (page table) of user...Process Address Space: The way to create virtual address (page table) of user...
Process Address Space: The way to create virtual address (page table) of user...
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Slab Allocator in Linux Kernel
Slab Allocator in Linux KernelSlab Allocator in Linux Kernel
Slab Allocator in Linux Kernel
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
 
Linux Performance Tunning Memory
Linux Performance Tunning MemoryLinux Performance Tunning Memory
Linux Performance Tunning Memory
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in Linux
 
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionLinux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Physical Memory Models.pdf
Physical Memory Models.pdfPhysical Memory Models.pdf
Physical Memory Models.pdf
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Process Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelProcess Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux Kernel
 
Using strace
Using straceUsing strace
Using strace
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Linux Huge Pages
Linux Huge PagesLinux Huge Pages
Linux Huge Pages
 

Semelhante a Linux Memory

Windows memory manager internals
Windows memory manager internalsWindows memory manager internals
Windows memory manager internalsSisimon Soman
 
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
 
Windows
WindowsWindows
WindowsEzzah
 
Virtual memory pre-final-formatting
Virtual memory pre-final-formattingVirtual memory pre-final-formatting
Virtual memory pre-final-formattingmarangburu42
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Virtual Memory Management For Operating System Kernels 5
Virtual Memory Management For Operating System Kernels 5Virtual Memory Management For Operating System Kernels 5
Virtual Memory Management For Operating System Kernels 5April Chesser
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Pagingjeyaperumal
 
381 ccs chapter7_updated(1)
381 ccs chapter7_updated(1)381 ccs chapter7_updated(1)
381 ccs chapter7_updated(1)Rabie Masoud
 
Chapter 04
Chapter 04Chapter 04
Chapter 04 Google
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinalmarangburu42
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858marangburu42
 

Semelhante a Linux Memory (20)

operating system
operating systemoperating system
operating system
 
08 Operating System Support
08  Operating  System  Support08  Operating  System  Support
08 Operating System Support
 
Memory comp
Memory compMemory comp
Memory comp
 
CH09.pdf
CH09.pdfCH09.pdf
CH09.pdf
 
Windows memory manager internals
Windows memory manager internalsWindows memory manager internals
Windows memory manager internals
 
Module4
Module4Module4
Module4
 
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
 
Windows
WindowsWindows
Windows
 
Virtual memory pre-final-formatting
Virtual memory pre-final-formattingVirtual memory pre-final-formatting
Virtual memory pre-final-formatting
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Virtual Memory Management For Operating System Kernels 5
Virtual Memory Management For Operating System Kernels 5Virtual Memory Management For Operating System Kernels 5
Virtual Memory Management For Operating System Kernels 5
 
VIRTUAL MEMORY
VIRTUAL MEMORYVIRTUAL MEMORY
VIRTUAL MEMORY
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Paging
 
VirutualMemory.docx
VirutualMemory.docxVirutualMemory.docx
VirutualMemory.docx
 
Vmfs
VmfsVmfs
Vmfs
 
381 ccs chapter7_updated(1)
381 ccs chapter7_updated(1)381 ccs chapter7_updated(1)
381 ccs chapter7_updated(1)
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinal
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 

Último

TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...
TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...
TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...TalentView
 
Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...
Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...
Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...IMARC Group
 
A flour, rice and Suji company in Jhang.
A flour, rice and Suji company in Jhang.A flour, rice and Suji company in Jhang.
A flour, rice and Suji company in Jhang.mcshagufta46
 
Tata Kelola Bisnis perushaan yang bergerak
Tata Kelola Bisnis perushaan yang bergerakTata Kelola Bisnis perushaan yang bergerak
Tata Kelola Bisnis perushaan yang bergerakEditores1
 
Borderless Access - Global Panel book-unlock 2024
Borderless Access - Global Panel book-unlock 2024Borderless Access - Global Panel book-unlock 2024
Borderless Access - Global Panel book-unlock 2024Borderless Access
 
BCE24 | Virtual Brand Ambassadors: Making Brands Personal - John Meulemans
BCE24 | Virtual Brand Ambassadors: Making Brands Personal - John MeulemansBCE24 | Virtual Brand Ambassadors: Making Brands Personal - John Meulemans
BCE24 | Virtual Brand Ambassadors: Making Brands Personal - John MeulemansBBPMedia1
 
Mihir Menda - Member of Supervisory Board at RMZ
Mihir Menda - Member of Supervisory Board at RMZMihir Menda - Member of Supervisory Board at RMZ
Mihir Menda - Member of Supervisory Board at RMZKanakChauhan5
 
Upgrade Your Banking Experience with Advanced Core Banking Applications
Upgrade Your Banking Experience with Advanced Core Banking ApplicationsUpgrade Your Banking Experience with Advanced Core Banking Applications
Upgrade Your Banking Experience with Advanced Core Banking ApplicationsIntellect Design Arena Ltd
 
HELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptx
HELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptxHELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptx
HELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptxHelene Heckrotte
 
Cracking the ‘Business Process Outsourcing’ Code Main.pptx
Cracking the ‘Business Process Outsourcing’ Code Main.pptxCracking the ‘Business Process Outsourcing’ Code Main.pptx
Cracking the ‘Business Process Outsourcing’ Code Main.pptxWorkforce Group
 
Introduction to The overview of GAAP LO 1-5.pptx
Introduction to The overview of GAAP LO 1-5.pptxIntroduction to The overview of GAAP LO 1-5.pptx
Introduction to The overview of GAAP LO 1-5.pptxJemalSeid25
 
The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...
The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...
The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...Brian Solis
 
NASA CoCEI Scaling Strategy - November 2023
NASA CoCEI Scaling Strategy - November 2023NASA CoCEI Scaling Strategy - November 2023
NASA CoCEI Scaling Strategy - November 2023Steve Rader
 
PDT 89 - $1.4M - Seed - Plantee Innovations.pdf
PDT 89 - $1.4M - Seed - Plantee Innovations.pdfPDT 89 - $1.4M - Seed - Plantee Innovations.pdf
PDT 89 - $1.4M - Seed - Plantee Innovations.pdfHajeJanKamps
 
Anyhr.io | Presentation HR&Recruiting agency
Anyhr.io | Presentation HR&Recruiting agencyAnyhr.io | Presentation HR&Recruiting agency
Anyhr.io | Presentation HR&Recruiting agencyHanna Klim
 
Entrepreneurship & organisations: influences and organizations
Entrepreneurship & organisations: influences and organizationsEntrepreneurship & organisations: influences and organizations
Entrepreneurship & organisations: influences and organizationsP&CO
 
Talent Management research intelligence_13 paradigm shifts_20 March 2024.pdf
Talent Management research intelligence_13 paradigm shifts_20 March 2024.pdfTalent Management research intelligence_13 paradigm shifts_20 March 2024.pdf
Talent Management research intelligence_13 paradigm shifts_20 March 2024.pdfCharles Cotter, PhD
 
AMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdf
AMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdfAMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdf
AMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdfJohnCarloValencia4
 
Ethical stalking by Mark Williams. UpliftLive 2024
Ethical stalking by Mark Williams. UpliftLive 2024Ethical stalking by Mark Williams. UpliftLive 2024
Ethical stalking by Mark Williams. UpliftLive 2024Winbusinessin
 

Último (20)

TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...
TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...
TalentView Webinar: Empowering the Modern Workforce_ Redefininig Success from...
 
Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...
Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...
Boat Trailers Market PPT: Growth, Outlook, Demand, Keyplayer Analysis and Opp...
 
A flour, rice and Suji company in Jhang.
A flour, rice and Suji company in Jhang.A flour, rice and Suji company in Jhang.
A flour, rice and Suji company in Jhang.
 
Tata Kelola Bisnis perushaan yang bergerak
Tata Kelola Bisnis perushaan yang bergerakTata Kelola Bisnis perushaan yang bergerak
Tata Kelola Bisnis perushaan yang bergerak
 
Borderless Access - Global Panel book-unlock 2024
Borderless Access - Global Panel book-unlock 2024Borderless Access - Global Panel book-unlock 2024
Borderless Access - Global Panel book-unlock 2024
 
BCE24 | Virtual Brand Ambassadors: Making Brands Personal - John Meulemans
BCE24 | Virtual Brand Ambassadors: Making Brands Personal - John MeulemansBCE24 | Virtual Brand Ambassadors: Making Brands Personal - John Meulemans
BCE24 | Virtual Brand Ambassadors: Making Brands Personal - John Meulemans
 
Mihir Menda - Member of Supervisory Board at RMZ
Mihir Menda - Member of Supervisory Board at RMZMihir Menda - Member of Supervisory Board at RMZ
Mihir Menda - Member of Supervisory Board at RMZ
 
Upgrade Your Banking Experience with Advanced Core Banking Applications
Upgrade Your Banking Experience with Advanced Core Banking ApplicationsUpgrade Your Banking Experience with Advanced Core Banking Applications
Upgrade Your Banking Experience with Advanced Core Banking Applications
 
HELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptx
HELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptxHELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptx
HELENE HECKROTTE'S PROFESSIONAL PORTFOLIO.pptx
 
Investment Opportunity for Thailand's Automotive & EV Industries
Investment Opportunity for Thailand's Automotive & EV IndustriesInvestment Opportunity for Thailand's Automotive & EV Industries
Investment Opportunity for Thailand's Automotive & EV Industries
 
Cracking the ‘Business Process Outsourcing’ Code Main.pptx
Cracking the ‘Business Process Outsourcing’ Code Main.pptxCracking the ‘Business Process Outsourcing’ Code Main.pptx
Cracking the ‘Business Process Outsourcing’ Code Main.pptx
 
Introduction to The overview of GAAP LO 1-5.pptx
Introduction to The overview of GAAP LO 1-5.pptxIntroduction to The overview of GAAP LO 1-5.pptx
Introduction to The overview of GAAP LO 1-5.pptx
 
The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...
The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...
The End of Business as Usual: Rewire the Way You Work to Succeed in the Consu...
 
NASA CoCEI Scaling Strategy - November 2023
NASA CoCEI Scaling Strategy - November 2023NASA CoCEI Scaling Strategy - November 2023
NASA CoCEI Scaling Strategy - November 2023
 
PDT 89 - $1.4M - Seed - Plantee Innovations.pdf
PDT 89 - $1.4M - Seed - Plantee Innovations.pdfPDT 89 - $1.4M - Seed - Plantee Innovations.pdf
PDT 89 - $1.4M - Seed - Plantee Innovations.pdf
 
Anyhr.io | Presentation HR&Recruiting agency
Anyhr.io | Presentation HR&Recruiting agencyAnyhr.io | Presentation HR&Recruiting agency
Anyhr.io | Presentation HR&Recruiting agency
 
Entrepreneurship & organisations: influences and organizations
Entrepreneurship & organisations: influences and organizationsEntrepreneurship & organisations: influences and organizations
Entrepreneurship & organisations: influences and organizations
 
Talent Management research intelligence_13 paradigm shifts_20 March 2024.pdf
Talent Management research intelligence_13 paradigm shifts_20 March 2024.pdfTalent Management research intelligence_13 paradigm shifts_20 March 2024.pdf
Talent Management research intelligence_13 paradigm shifts_20 March 2024.pdf
 
AMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdf
AMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdfAMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdf
AMAZON SELLER VIRTUAL ASSISTANT PRODUCT RESEARCH .pdf
 
Ethical stalking by Mark Williams. UpliftLive 2024
Ethical stalking by Mark Williams. UpliftLive 2024Ethical stalking by Mark Williams. UpliftLive 2024
Ethical stalking by Mark Williams. UpliftLive 2024
 

Linux Memory

  • 1. Principles of Virtual Memory Virtual Memory, Paging, Segmentation
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. 2.1 What i s Paging? Page 7 Page 5 Page 4 Page 3 Page 2 Page 1 Page 6 Virtual memory (divided into equal size pages) Page 0 0x00 Page Table (one per process, one entry per page maintained by OS) Page 7 Page 5 Page 4 Page 3 Page 2 Page 1 Page 6 Page 0 v v v Frame 0 Frame 1 Frame 3 Frame 0 Frame 1 Frame 2 Frame 3 Physical memory (divided into equal size page frames) 0x00 v v v
  • 17. 2.2 Paging: Implementation Typical Page Table Entry other Page Frame # execute x write w read r r w x valid v r w x v referenced re v re modified m re m shared s m s caching disabled c s c super - page su c su process id pid su pid guard data (extended) guard gd g pid g gd g gd other
  • 18. 2.2 Paging: Implementation Singlelevel Page Tables Problem: Page tables can get very large , e.g. 32 bit address space, 4KB pages  2^20 entries per process  4MB at 4B per entry 64 bit  16777216 GB page table!!!! one entry per page one table per process 0x14 0x 2 Virtual address Page # Offset Physical address 0x14 Offset 0x8 Frame # Page Table Base Register (PTBR) Page Table 0x8 ... 0x0 * L 0x1 * L 0x2 * L L : size of entry
  • 19. 2.2 Paging: Implementation Multilevel Page Tables not all need be present saves memory table size can be restricted to one page Offset Page #1 Page #2 Page #3 Page Directory Page Middle Directory Page Table Page Frame # Offset Offset Frame # Oversized Super -P age v=0
  • 20.
  • 21. Steps in Handling a Page Fault
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. 2. 6 Summary: Conversion o f a Virtual Address Virtual address Physical address OS Hard ware no protection fault reference legal? copy on write? HDD I/O complete: interrupt memory full? update page table process into ready state copy page process into blocking state yes page fault no exception to process no TLB page table miss page in mem? hit access rights? yes update TLB yes exception to process no swap out a page yes HDD I/O read req. no yes bring in page from HDD ! process into blocking state
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 39. Shared Library Using Virtual Memory
  • 40.
  • 41.
  • 42.