SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
1
Ch4 Virtual Process Memory
Bob.Fu
勿上傳公司網站
2
● Page Table(ARM32)
● Task & Page Table
● Process Mapping
● Page Fault(ARM32)
5
Page Table
0x0
virtual address
page table
level 1
physical address
1m
4096
level 1
indexVA
1m
6
Page Table
0x0
virtual address
page table
level 1
page table
level 2
physical address
4k
4k
1m
4096
256
VA
level 1
index
level 2
index
1m
7
Task & Page Table
1. 一個 page table 代表一個 virtual space
8
Task & Page Table
app
mm
1. 一個 page table 代表一個 virtual space
2. 一個 task 對應一個 page table( 透過 mm)
9
Task & Page Table
kthread kthread app2
app3
thread2
app
app3
thread1
TTBR0
mmmm mm mm
10
Task & Page Table
vma
vma
user space 建 mapping --> 建 vma
kernel space 建 mapping --> 填 page table
注意 : 建 vma 不代表填 page table( 等 fault 填 )
vma
app1
mm
12
Process Mapping
vma
vma
vma
task
mm
parent
13
Process Mapping
vma
vma
vma
vma
vma
vma
task
mm
task
mm
fork
parent child
14
Process Mapping
vma
vma
vma
task
mm
vma
vma
vma
mm
task
vma
mm
fork execve
parent child
15
Process Mapping
vma
vma
vma
parent task
virtual physical
16
Process Mapping
vma
vma
vma
vma
vma
vma
parent task
virtual physical
child task
virtual
fork
17
Process Mapping
vma
vma
vma
vma
vma
vma
parent task
virtual physical
child task
virtual
if write?
18
Process Mapping
vma
vma
vma
parent task
virtual physical
child task
virtual
vma
execve
19
Process Mapping
physical
child task
virtual
vma [stack]
20
Process Mapping
physical
child task
virtual vma app-text
vma app-data
vma [heap]
vma [sigpage]
vma ld-text
vma ld-data
vma [stack]
不會先 fault
但 fault 了會 readahead
21
Process Mapping
physical
child task
virtual vma app-text
vma app-data
vma [heap]
vma [sigpage]
vma ld-text
vma ld-data
vma [stack]
vma libc-text
vma libc-data
vma libgcc-text
vma libgcc-data
vma libgcc-text
vma libgcc-data
22
Process Mapping
physical
child task
virtual vma app-text [file mapping]
vma app-data
vma [heap] [anonymous mapping]
vma [sigpage]
vma ld-text
vma ld-data
vma [stack]
vma libc-text
vma libc-data
vma libgcc-text
vma libgcc-data
vma libgcc-text
vma libgcc-data
argument
environment
23
Process Mapping
24
Page Fault
dabt@svc
dabt@usr
pabt@svc
pabt@usr
0
5
7
31
0
5
15
7
31
15
do_page_fault
1. copy on write
2. file mapping
3. anonymous mapping
4. swap(ch18)
5. real bug
25
Page Fault: Copy on Write
parent task
virtual physical
child task
virtual
if write?
1. 配置 pfn
(highmem 佳 )
26
Page Fault: Copy on Write
parent task
virtual physical
child task
virtual
if write?
1. 配置 pfn
(highmem 佳 )
2. 複製 data
27
Page Fault: Copy on Write
parent task
virtual physical
child task
virtual
if write?
1. 配置 pfn
(highmem 佳 )
2. 複製 data
3. 改 page table
28
Page Fault: File Mapping
physical
child task
virtual vma app-text [file mapping]
vma app-data
vma [heap]
disk
fault@file_mapping
1. 配置 pfn
(highmem 佳 )
29
Page Fault: File Mapping
vma app-text [file mapping]
vma app-data
vma [heap]
disk
read in
fault@file_mapping
1. 配置 pfn
(highmem 佳 )
2. 讀入 data
physical
child task
virtual
30
Page Fault: File Mapping
vma app-text [file mapping]
vma app-data
vma [heap]
disk
read in
fault@file_mapping
1. 配置 pfn
(highmem 佳 )
2. 讀入 data
3. 填 page table
physical
child task
virtual
31
Page Fault: Anon Mapping
vma app-text [file mapping]
vma app-data
vma [heap] [anonymous mapping]
disk
read in
fault@file_mapping
1. 配置 pfn
(highmem 佳 )
2. 讀入 data
3. 填 page table
fault@anon_mapping
1. 配置 pfn
(highmem 佳 )
physical
child task
virtual
32
Page Fault: Anon Mapping
vma app-text [file mapping]
vma app-data
vma [heap] [anonymous mapping]
disk
read in
fault@file_mapping
1. 配置 pfn
(highmem 佳 )
2. 讀入 data
3. 填 page table
fault@anon_mapping
1. 配置 pfn
(highmem 佳 )
2. memset 0
physical
child task
virtual
33
Page Fault: Anon Mapping
vma app-text [file mapping]
vma app-data
vma [heap] [anonymous mapping]
disk
read in
fault@file_mapping
1. 配置 pfn
(highmem 佳 )
2. 讀入 data
3. 填 page table
fault@anon_mapping
1. 配置 pfn
(highmem 佳 )
2. memset 0
3. 填 page table
physical
child task
virtual
34
Page Fault: Swap
ch18
35
END

Contenu connexe

En vedette (6)

IEEE Standards
IEEE StandardsIEEE Standards
IEEE Standards
 
Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)
 
Choppers
ChoppersChoppers
Choppers
 
Dc Choppers
Dc ChoppersDc Choppers
Dc Choppers
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similaire à ch4-pv2-virtual-process-memory

Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
longtuan
 
Planning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Planning and What's New in Windows Server 2008 R2 SP1 for VirtualizationPlanning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Planning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Lai Yoong Seng
 
Windows kernel debugging session 2
Windows kernel debugging session 2Windows kernel debugging session 2
Windows kernel debugging session 2
Sisimon Soman
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
Joe Kutner
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
programmermag
 

Similaire à ch4-pv2-virtual-process-memory (20)

Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux KernelMemory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel
 
Streaming Architecture Walkthrough.pdf
Streaming Architecture Walkthrough.pdfStreaming Architecture Walkthrough.pdf
Streaming Architecture Walkthrough.pdf
 
INFLOW-2014-NVM-Compression
INFLOW-2014-NVM-CompressionINFLOW-2014-NVM-Compression
INFLOW-2014-NVM-Compression
 
oVirt DR Site to-site using ansible
oVirt DR Site to-site using ansibleoVirt DR Site to-site using ansible
oVirt DR Site to-site using ansible
 
Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
 
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionLinux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
 
Gearman - Job Queue
Gearman - Job QueueGearman - Job Queue
Gearman - Job Queue
 
Dpm Disaster Recovery Sonvu
Dpm Disaster Recovery SonvuDpm Disaster Recovery Sonvu
Dpm Disaster Recovery Sonvu
 
Operating CloudStack: Sharing My Tool Box @ApacheCon NA'15
Operating CloudStack: Sharing My Tool Box @ApacheCon NA'15Operating CloudStack: Sharing My Tool Box @ApacheCon NA'15
Operating CloudStack: Sharing My Tool Box @ApacheCon NA'15
 
Planning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Planning and What's New in Windows Server 2008 R2 SP1 for VirtualizationPlanning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Planning and What's New in Windows Server 2008 R2 SP1 for Virtualization
 
Planning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Planning and What's New in Windows Server 2008 R2 SP1 for VirtualizationPlanning and What's New in Windows Server 2008 R2 SP1 for Virtualization
Planning and What's New in Windows Server 2008 R2 SP1 for Virtualization
 
Windows kernel debugging session 2
Windows kernel debugging session 2Windows kernel debugging session 2
Windows kernel debugging session 2
 
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
 
Atmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern DatacenterAtmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern Datacenter
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
 
Heat up your stack
Heat up your stackHeat up your stack
Heat up your stack
 
Puppet Camp Boston 2014: Orchestrating Infrastructure Change Using Puppet Rak...
Puppet Camp Boston 2014: Orchestrating Infrastructure Change Using Puppet Rak...Puppet Camp Boston 2014: Orchestrating Infrastructure Change Using Puppet Rak...
Puppet Camp Boston 2014: Orchestrating Infrastructure Change Using Puppet Rak...
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
 
XenApp Load Balancing
XenApp Load BalancingXenApp Load Balancing
XenApp Load Balancing
 
打造真正的软件
打造真正的软件打造真正的软件
打造真正的软件
 

Plus de yushiang fu

ch15-pv1-time-management
ch15-pv1-time-managementch15-pv1-time-management
ch15-pv1-time-management
yushiang fu
 
ch13-pv1-system-calls
ch13-pv1-system-callsch13-pv1-system-calls
ch13-pv1-system-calls
yushiang fu
 
ch9-pv1-the-extended-filesystem-family
ch9-pv1-the-extended-filesystem-familych9-pv1-the-extended-filesystem-family
ch9-pv1-the-extended-filesystem-family
yushiang fu
 
ch8-pv1-the-virtual-filesystem
ch8-pv1-the-virtual-filesystemch8-pv1-the-virtual-filesystem
ch8-pv1-the-virtual-filesystem
yushiang fu
 
ch6-pv2-device-drivers
ch6-pv2-device-driversch6-pv2-device-drivers
ch6-pv2-device-drivers
yushiang fu
 
ch3-pv1-memory-management
ch3-pv1-memory-managementch3-pv1-memory-management
ch3-pv1-memory-management
yushiang fu
 

Plus de yushiang fu (7)

ch15-pv1-time-management
ch15-pv1-time-managementch15-pv1-time-management
ch15-pv1-time-management
 
ch13-pv1-system-calls
ch13-pv1-system-callsch13-pv1-system-calls
ch13-pv1-system-calls
 
ch9-pv1-the-extended-filesystem-family
ch9-pv1-the-extended-filesystem-familych9-pv1-the-extended-filesystem-family
ch9-pv1-the-extended-filesystem-family
 
ch8-pv1-the-virtual-filesystem
ch8-pv1-the-virtual-filesystemch8-pv1-the-virtual-filesystem
ch8-pv1-the-virtual-filesystem
 
ch7-pv1-modules
ch7-pv1-modulesch7-pv1-modules
ch7-pv1-modules
 
ch6-pv2-device-drivers
ch6-pv2-device-driversch6-pv2-device-drivers
ch6-pv2-device-drivers
 
ch3-pv1-memory-management
ch3-pv1-memory-managementch3-pv1-memory-management
ch3-pv1-memory-management
 

ch4-pv2-virtual-process-memory