SlideShare a Scribd company logo
11/30/17 1
Paging and Segmentation
By
SATHISHKUMAR G
(sathishsak111@gmail.com)
11/30/17 2
Paging
• Goals
» make allocation and
swapping easier
• Make all chunks of
memory the same size
» call each chunk a
“PAGE”
» example page sizes are
512 bytes, 1K, 4K, 8K,
etc
» pages have been getting
bigger with time
» we’ll discuss reasons
why pages should be of
a certain size as the
week progresses.
Page # Offset
Virtual Address
Page
Table
Base
Register
+
+
=>
physical
address
Page Table
Each entry
in the page
table is a
“Page Table
Entry”
11/30/17 3
An Example
• Pages are 1024 bytes long
» this says that bottom 10 bits of the VA is the offset
• PTBR contains 2000
» this says that the first page table entry for this process is at physical
memory location 2000
• Virtual address is 2256
» this says “page 2, offset 256”
• Physical memory location 2004 contains 8192
» this says that each PTE is 4 bytes (1 word)
» and that the second page of this process’s address space can be
found at memory location 8192.
• So, we add 256 to 8192 and we get the real data!
11/30/17 4
What does a PTE contain?
M-bit V-bit Protection bits Page Frame Number
• The Modify bit says whether or not the page has been written.
» it is updated each time a WRITE to the page occurs.
• The Reference bit says whether or not the page has been touched
» it is updated each time a READ or a WRITE occurs
• The V bit says whether or not the PTE can be used
» it is checked each time the virtual address is used
• The Protection bits say what operations are allowed on this page
» READ, WRITE, EXECUTE
• The Page Frame Number says where in memory is the page
R-bit
1 1 1 1-2 about 20
11/30/17 5
Evaluating Paging
• Easy to allocate memory
» memory comes from a free list of fixed size chunks.
» to find a new page, get anything off the free list.
» external fragmentation not a problem
• easy to swap out pieces of a program
» since all pieces are the same size.
» use valid bit to detect references to swapped pages
» pages are a nice multiple of the disk block size.
• Can still have internal fragmentation
• Table space can become a serious problem
» especially bad with small pages
– eg, w/a 32bit address space and 1k size pages, that’s 222
pages or that many
ptes which is a lot!
• Memory reference overhead can be high
» 2 refs for every one
11/30/17 6
Segmentation and Paging
at the Same Time
• Provide for two levels of mapping
• Use segments to contain logically related things
» code, data, stack
» can vary in size but are generally large.
• Use pages to describe components of the segments
» makes segments easy to manage and can swap memory between
segments.
» need to allocate page table entries only for those pieces of the
segments that have themselves been allocated.
• Segments that are shared can be represented with shared page
tables for the segments themselves.
11/30/17 7
An Early Example -- IBM System 370
24 bit virtual address
4 bits 8 bits 12 bits
Segment
Table
Page Table
+
simple bit operation
Real Memory
11/30/17 8
Lookups
• Each memory reference can be 3
» assuming no fault
• Can exploit locality to improve lookup strategy
» a process is likely to use only a few pages at a time
• Use Translation Lookaside buffer to exploit locality
» a TLB is a fast associative memory that keeps track of recent translations.
• The hardware searches the TLB on a memory reference
• On a TLB miss, either a hardware or software exception can occur
» older machines reloaded the TLB in hardware
» newer RISC machines tend to use software loaded TLBs
– can have any structure you want for the page table
– fast handler computes and goes. Eg, the MIPS.
11/30/17 9
Hard versus soft page faults
• Hard page faults are those page faults that require issuing a
read from secondary storage.
• Soft page faults are those page faults where the page is already
in main memory however the TLB and/or the PTE has marked
the page as invalid.
» Soft faults are used when Hardware support is not available to
handle TLB misses
» Soft faults can also be used in implement certain page replacement
algorithms. More to come.
11/30/17 10
A TLB
• A small fully associative cache
• Each entry contains a tag and a
value.
» tags are virtual page numbers
» values are physical page table
entries.
• Problems include
» keeping the TLB consistent with
the PTE in main memory
– valid and ref bits, for example
» keeping TLBs consistent on an
MP.
» quickly loading the TLB on a
miss.
• Hit rates are important.
Tag Value
0xfff1000
0xfff1000
0xa10100
0xbbbb00
0x1111aa11
?
0x12341111
11/30/17 11
Selecting a page size
• Small pages give you lots of flexibility but at a high cost.
• Big pages are easy to manage, but not very flexible.
• Issues include
» TLB coverage
– product of page size and # entries
» internal fragmentation
– likely to use less of a big page
» # page faults and prefetch effect
– small pages will force you to fault often
» match to I/O bandwidth
– want one miss to bring in a lot of data since it will take a long time.
11/30/17 12
State of maintained by MM
• MM usually maintains a list of physical pages according to the
following attributes (various implementations use slightly
different lists)
» Zeroed pages
» Free pages
» Standby pages
» Modified pages
» Modified No Write pages
» Bad pages
• MM’s goal is to use these pages on these lists to supply
memory for both soft and hard page faults
• MM can have a modified page writer process that goes around
and flushes out dirty pages.
11/30/17 13
Thank you

More Related Content

What's hot

Segmentation geekssay.com
Segmentation  geekssay.comSegmentation  geekssay.com
Segmentation geekssay.com
Hemant Gautam
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
Raj Mohan
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
hamza haseeb
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
Priyanka bisht
 
OSCh10
OSCh10OSCh10
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
 
Memory management
Memory managementMemory management
Memory management
cpjcollege
 
Memory management
Memory managementMemory management
Memory management
Imran Khan
 
ppt
pptppt
Computer memory management
Computer memory managementComputer memory management
Computer memory management
Kumar
 
Memory Management
Memory ManagementMemory Management
Memory Management
Ramasubbu .P
 
Memory management
Memory managementMemory management
Memory management
Muhammad Fayyaz
 
Operating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page TableOperating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page Table
Zishan Mohsin
 
Memory management
Memory managementMemory management
Memory management
Mohammad Sadiq
 
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
Rai University
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
Mazin Alwaaly
 
OS_Ch9
OS_Ch9OS_Ch9
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
sanjana mun
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Ishwar Dhumal
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
Wayne Jones Jnr
 

What's hot (20)

Segmentation geekssay.com
Segmentation  geekssay.comSegmentation  geekssay.com
Segmentation geekssay.com
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 
OSCh10
OSCh10OSCh10
OSCh10
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 
ppt
pptppt
ppt
 
Computer memory management
Computer memory managementComputer memory management
Computer memory management
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Operating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page TableOperating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page Table
 
Memory management
Memory managementMemory management
Memory management
 
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
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 

Similar to Paging and Segmentation

Segmentation with paging methods and techniques
Segmentation with paging methods and techniquesSegmentation with paging methods and techniques
Segmentation with paging methods and techniques
nikhilrana24112003
 
Segmentation and paging
Segmentation and paging Segmentation and paging
Segmentation and paging
RohanSharma573161
 
Ppt
PptPpt
Operating system 35 paging
Operating system 35 pagingOperating system 35 paging
Operating system 35 paging
Vaibhav Khanna
 
The life and times
The life and timesThe life and times
The life and times
Abeer Naskar
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptx
RAJESH S
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
ItechAnand1
 
Vm
VmVm
OS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptxOS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptx
Pankaj Debbarma
 
Os4
Os4Os4
Os4
Os4Os4
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
Harika Pudugosula
 
cache memory introduction, level, function
cache memory introduction, level, functioncache memory introduction, level, function
cache memory introduction, level, function
TeddyIswahyudi1
 
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Alluxio, Inc.
 
Memory Management Strategies - IV.pdf
Memory Management Strategies - IV.pdfMemory Management Strategies - IV.pdf
Memory Management Strategies - IV.pdf
Harika Pudugosula
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory management
Dr. Loganathan R
 
Virtual Memory.pdf
Virtual Memory.pdfVirtual Memory.pdf
Virtual Memory.pdf
SujanTimalsina5
 
CAO-Unit-III.pptx
CAO-Unit-III.pptxCAO-Unit-III.pptx
CAO-Unit-III.pptx
ClassicFUKRA
 
Driver development – memory management
Driver development – memory managementDriver development – memory management
Driver development – memory management
Vandana Salve
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
J Singh
 

Similar to Paging and Segmentation (20)

Segmentation with paging methods and techniques
Segmentation with paging methods and techniquesSegmentation with paging methods and techniques
Segmentation with paging methods and techniques
 
Segmentation and paging
Segmentation and paging Segmentation and paging
Segmentation and paging
 
Ppt
PptPpt
Ppt
 
Operating system 35 paging
Operating system 35 pagingOperating system 35 paging
Operating system 35 paging
 
The life and times
The life and timesThe life and times
The life and times
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptx
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Vm
VmVm
Vm
 
OS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptxOS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptx
 
Os4
Os4Os4
Os4
 
Os4
Os4Os4
Os4
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
cache memory introduction, level, function
cache memory introduction, level, functioncache memory introduction, level, function
cache memory introduction, level, function
 
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-sensitive queries for Presto at Facebook: A Collaboration ...
 
Memory Management Strategies - IV.pdf
Memory Management Strategies - IV.pdfMemory Management Strategies - IV.pdf
Memory Management Strategies - IV.pdf
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory management
 
Virtual Memory.pdf
Virtual Memory.pdfVirtual Memory.pdf
Virtual Memory.pdf
 
CAO-Unit-III.pptx
CAO-Unit-III.pptxCAO-Unit-III.pptx
CAO-Unit-III.pptx
 
Driver development – memory management
Driver development – memory managementDriver development – memory management
Driver development – memory management
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
 

More from sathish sak

TRANSPARENT CONCRE
TRANSPARENT CONCRETRANSPARENT CONCRE
TRANSPARENT CONCRE
sathish sak
 
Stationary Waves
Stationary WavesStationary Waves
Stationary Waves
sathish sak
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
sathish sak
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
sathish sak
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles
sathish sak
 
Digital Logic Circuits
Digital Logic CircuitsDigital Logic Circuits
Digital Logic Circuits
sathish sak
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
sathish sak
 
Real-Time Signal Processing: Implementation and Application
Real-Time Signal Processing:  Implementation and ApplicationReal-Time Signal Processing:  Implementation and Application
Real-Time Signal Processing: Implementation and Application
sathish sak
 
DIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWDIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEW
sathish sak
 
FRACTAL ROBOTICS
FRACTAL  ROBOTICSFRACTAL  ROBOTICS
FRACTAL ROBOTICS
sathish sak
 
Electro bike
Electro bikeElectro bike
Electro bike
sathish sak
 
ROBOTIC SURGERY
ROBOTIC SURGERYROBOTIC SURGERY
ROBOTIC SURGERY
sathish sak
 
POWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTPOWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANT
sathish sak
 
mathematics application fiels of engineering
mathematics application fiels of engineeringmathematics application fiels of engineering
mathematics application fiels of engineering
sathish sak
 
Plastics…
Plastics…Plastics…
Plastics…
sathish sak
 
ENGINEERING
ENGINEERINGENGINEERING
ENGINEERING
sathish sak
 
ENVIRONMENTAL POLLUTION
ENVIRONMENTALPOLLUTIONENVIRONMENTALPOLLUTION
ENVIRONMENTAL POLLUTION
sathish sak
 
RFID TECHNOLOGY
RFID TECHNOLOGYRFID TECHNOLOGY
RFID TECHNOLOGY
sathish sak
 
green chemistry
green chemistrygreen chemistry
green chemistry
sathish sak
 
NANOTECHNOLOGY
  NANOTECHNOLOGY	  NANOTECHNOLOGY
NANOTECHNOLOGY
sathish sak
 

More from sathish sak (20)

TRANSPARENT CONCRE
TRANSPARENT CONCRETRANSPARENT CONCRE
TRANSPARENT CONCRE
 
Stationary Waves
Stationary WavesStationary Waves
Stationary Waves
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles
 
Digital Logic Circuits
Digital Logic CircuitsDigital Logic Circuits
Digital Logic Circuits
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Real-Time Signal Processing: Implementation and Application
Real-Time Signal Processing:  Implementation and ApplicationReal-Time Signal Processing:  Implementation and Application
Real-Time Signal Processing: Implementation and Application
 
DIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWDIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEW
 
FRACTAL ROBOTICS
FRACTAL  ROBOTICSFRACTAL  ROBOTICS
FRACTAL ROBOTICS
 
Electro bike
Electro bikeElectro bike
Electro bike
 
ROBOTIC SURGERY
ROBOTIC SURGERYROBOTIC SURGERY
ROBOTIC SURGERY
 
POWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTPOWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANT
 
mathematics application fiels of engineering
mathematics application fiels of engineeringmathematics application fiels of engineering
mathematics application fiels of engineering
 
Plastics…
Plastics…Plastics…
Plastics…
 
ENGINEERING
ENGINEERINGENGINEERING
ENGINEERING
 
ENVIRONMENTAL POLLUTION
ENVIRONMENTALPOLLUTIONENVIRONMENTALPOLLUTION
ENVIRONMENTAL POLLUTION
 
RFID TECHNOLOGY
RFID TECHNOLOGYRFID TECHNOLOGY
RFID TECHNOLOGY
 
green chemistry
green chemistrygreen chemistry
green chemistry
 
NANOTECHNOLOGY
  NANOTECHNOLOGY	  NANOTECHNOLOGY
NANOTECHNOLOGY
 

Recently uploaded

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 

Recently uploaded (20)

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 

Paging and Segmentation

  • 1. 11/30/17 1 Paging and Segmentation By SATHISHKUMAR G (sathishsak111@gmail.com)
  • 2. 11/30/17 2 Paging • Goals » make allocation and swapping easier • Make all chunks of memory the same size » call each chunk a “PAGE” » example page sizes are 512 bytes, 1K, 4K, 8K, etc » pages have been getting bigger with time » we’ll discuss reasons why pages should be of a certain size as the week progresses. Page # Offset Virtual Address Page Table Base Register + + => physical address Page Table Each entry in the page table is a “Page Table Entry”
  • 3. 11/30/17 3 An Example • Pages are 1024 bytes long » this says that bottom 10 bits of the VA is the offset • PTBR contains 2000 » this says that the first page table entry for this process is at physical memory location 2000 • Virtual address is 2256 » this says “page 2, offset 256” • Physical memory location 2004 contains 8192 » this says that each PTE is 4 bytes (1 word) » and that the second page of this process’s address space can be found at memory location 8192. • So, we add 256 to 8192 and we get the real data!
  • 4. 11/30/17 4 What does a PTE contain? M-bit V-bit Protection bits Page Frame Number • The Modify bit says whether or not the page has been written. » it is updated each time a WRITE to the page occurs. • The Reference bit says whether or not the page has been touched » it is updated each time a READ or a WRITE occurs • The V bit says whether or not the PTE can be used » it is checked each time the virtual address is used • The Protection bits say what operations are allowed on this page » READ, WRITE, EXECUTE • The Page Frame Number says where in memory is the page R-bit 1 1 1 1-2 about 20
  • 5. 11/30/17 5 Evaluating Paging • Easy to allocate memory » memory comes from a free list of fixed size chunks. » to find a new page, get anything off the free list. » external fragmentation not a problem • easy to swap out pieces of a program » since all pieces are the same size. » use valid bit to detect references to swapped pages » pages are a nice multiple of the disk block size. • Can still have internal fragmentation • Table space can become a serious problem » especially bad with small pages – eg, w/a 32bit address space and 1k size pages, that’s 222 pages or that many ptes which is a lot! • Memory reference overhead can be high » 2 refs for every one
  • 6. 11/30/17 6 Segmentation and Paging at the Same Time • Provide for two levels of mapping • Use segments to contain logically related things » code, data, stack » can vary in size but are generally large. • Use pages to describe components of the segments » makes segments easy to manage and can swap memory between segments. » need to allocate page table entries only for those pieces of the segments that have themselves been allocated. • Segments that are shared can be represented with shared page tables for the segments themselves.
  • 7. 11/30/17 7 An Early Example -- IBM System 370 24 bit virtual address 4 bits 8 bits 12 bits Segment Table Page Table + simple bit operation Real Memory
  • 8. 11/30/17 8 Lookups • Each memory reference can be 3 » assuming no fault • Can exploit locality to improve lookup strategy » a process is likely to use only a few pages at a time • Use Translation Lookaside buffer to exploit locality » a TLB is a fast associative memory that keeps track of recent translations. • The hardware searches the TLB on a memory reference • On a TLB miss, either a hardware or software exception can occur » older machines reloaded the TLB in hardware » newer RISC machines tend to use software loaded TLBs – can have any structure you want for the page table – fast handler computes and goes. Eg, the MIPS.
  • 9. 11/30/17 9 Hard versus soft page faults • Hard page faults are those page faults that require issuing a read from secondary storage. • Soft page faults are those page faults where the page is already in main memory however the TLB and/or the PTE has marked the page as invalid. » Soft faults are used when Hardware support is not available to handle TLB misses » Soft faults can also be used in implement certain page replacement algorithms. More to come.
  • 10. 11/30/17 10 A TLB • A small fully associative cache • Each entry contains a tag and a value. » tags are virtual page numbers » values are physical page table entries. • Problems include » keeping the TLB consistent with the PTE in main memory – valid and ref bits, for example » keeping TLBs consistent on an MP. » quickly loading the TLB on a miss. • Hit rates are important. Tag Value 0xfff1000 0xfff1000 0xa10100 0xbbbb00 0x1111aa11 ? 0x12341111
  • 11. 11/30/17 11 Selecting a page size • Small pages give you lots of flexibility but at a high cost. • Big pages are easy to manage, but not very flexible. • Issues include » TLB coverage – product of page size and # entries » internal fragmentation – likely to use less of a big page » # page faults and prefetch effect – small pages will force you to fault often » match to I/O bandwidth – want one miss to bring in a lot of data since it will take a long time.
  • 12. 11/30/17 12 State of maintained by MM • MM usually maintains a list of physical pages according to the following attributes (various implementations use slightly different lists) » Zeroed pages » Free pages » Standby pages » Modified pages » Modified No Write pages » Bad pages • MM’s goal is to use these pages on these lists to supply memory for both soft and hard page faults • MM can have a modified page writer process that goes around and flushes out dirty pages.