SlideShare une entreprise Scribd logo
1  sur  33
Caching and TLBs Andy Wang Operating Systems COP 4610 / CGS 5765
Caching ,[object Object],[object Object],[object Object]
Caching in Memory Hierarchy ,[object Object],[object Object],$0.001/MB < 200 GB 5-50 msec Disk Secondary memory $0.1/MB < 4GB 1-4 clock cycles Main memory <10 MB 1-2 clock cycles Cache On chip ~500 bytes 1 clock cycle Registers Primary memory Cost Size Access Time
Caching in Memory Hierarchy ,[object Object],[object Object],[object Object],[object Object],[object Object]
Locality in Access Patterns ,[object Object],[object Object],[object Object],[object Object]
Caching ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Generic Issues in Caching ,[object Object],[object Object],[object Object],[object Object],[object Object]
Effective Access Time ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implications ,[object Object],[object Object],[object Object]
Reasons for Cache Misses ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reasons for Cache Misses ,[object Object],[object Object],[object Object],[object Object]
Design Issues of Caching ,[object Object],[object Object],[object Object]
Caching Applied to Address Translation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Caching Applied to Address Translation Virtual  addresses Physical addresses Data reads or writes (untranslated) TLB Translation table In TLB
Example of the TLB Content Valid, rw 4 0 Invalid - - Valid, rw 1 2 Control bits Physical page number (PPN) Virtual page number (VPN)
TLB Lookups ,[object Object],[object Object],[object Object]
Direct Mapping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Direct Mapping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
TLB Lookups ,[object Object],[object Object],[object Object],[object Object]
Two-Way Associative Cache VPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN hash = =
Two-Way Associative Cache VPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN hash = =
Two-Way Associative Cache VPN If miss, translate and replace one of the entries VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN hash = =
TLB Lookups ,[object Object],[object Object],[object Object],[object Object]
Fully Associative Cache VPN VPN PPN VPN PPN VPN PPN hash = = =
Fully Associative Cache VPN VPN PPN VPN PPN VPN PPN hash = = =
Fully Associative Cache VPN VPN PPN VPN PPN VPN PPN If miss, translate and replace one of the entries hash = = =
TLB Lookups ,[object Object],[object Object],[object Object]
Replacement of TLB Entries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Replacement of TLB Entries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Consistency Between TLB and Page Tables ,[object Object],[object Object],[object Object],[object Object],[object Object]
Relationship Between TLB and HW Memory Caches ,[object Object],[object Object],[object Object]
Relationship Between TLB and HW Memory Caches Data reads or writes (untranslated) VA data VA data Virtually  addressed cache TLB PA data PA data Physically  addressed cache PA data PA data PA data PA data Translation  tables
Two Ways to Commit Data Changes ,[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Kafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINE
Kafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINEKafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINE
Kafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINE
kawamuray
 

Tendances (20)

Debunking Common Myths in Stream Processing
Debunking Common Myths in Stream ProcessingDebunking Common Myths in Stream Processing
Debunking Common Myths in Stream Processing
 
Securing dns records from subdomain takeover
Securing dns records from subdomain takeoverSecuring dns records from subdomain takeover
Securing dns records from subdomain takeover
 
First Flink Bay Area meetup
First Flink Bay Area meetupFirst Flink Bay Area meetup
First Flink Bay Area meetup
 
HBaseConAsia2018 Track3-4: HBase and OpenTSDB practice at Huawei
HBaseConAsia2018 Track3-4: HBase and OpenTSDB practice at HuaweiHBaseConAsia2018 Track3-4: HBase and OpenTSDB practice at Huawei
HBaseConAsia2018 Track3-4: HBase and OpenTSDB practice at Huawei
 
Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014
Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014
Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014
 
Hadoop Hardware @Twitter: Size does matter!
Hadoop Hardware @Twitter: Size does matter!Hadoop Hardware @Twitter: Size does matter!
Hadoop Hardware @Twitter: Size does matter!
 
Fluentd and Distributed Logging at Kubecon
Fluentd and Distributed Logging at KubeconFluentd and Distributed Logging at Kubecon
Fluentd and Distributed Logging at Kubecon
 
Go at uber
Go at uberGo at uber
Go at uber
 
Kafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINE
Kafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINEKafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINE
Kafka Multi-Tenancy - 160 Billion Daily Messages on One Shared Cluster at LINE
 
Docker and Fluentd (revised)
Docker and Fluentd (revised)Docker and Fluentd (revised)
Docker and Fluentd (revised)
 
HBase: How to get MTTR below 1 minute
HBase: How to get MTTR below 1 minuteHBase: How to get MTTR below 1 minute
HBase: How to get MTTR below 1 minute
 
Monitoring Cassandra With An EYE
Monitoring Cassandra With An EYEMonitoring Cassandra With An EYE
Monitoring Cassandra With An EYE
 
Mass Report Generation Using REST APIs
Mass Report Generation Using REST APIsMass Report Generation Using REST APIs
Mass Report Generation Using REST APIs
 
Flink Forward SF 2017: Cliff Resnick & Seth Wiesman - From Zero to Streami...
Flink Forward SF 2017:  Cliff Resnick & Seth Wiesman -   From Zero to Streami...Flink Forward SF 2017:  Cliff Resnick & Seth Wiesman -   From Zero to Streami...
Flink Forward SF 2017: Cliff Resnick & Seth Wiesman - From Zero to Streami...
 
EKAW - Publishing with Triple Pattern Fragments
EKAW - Publishing with Triple Pattern FragmentsEKAW - Publishing with Triple Pattern Fragments
EKAW - Publishing with Triple Pattern Fragments
 
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud" Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
 
Stateful streaming and the challenge of state
Stateful streaming and the challenge of stateStateful streaming and the challenge of state
Stateful streaming and the challenge of state
 
Kafka Summit SF 2017 - MultiCluster, MultiTenant and Hierarchical Kafka Messa...
Kafka Summit SF 2017 - MultiCluster, MultiTenant and Hierarchical Kafka Messa...Kafka Summit SF 2017 - MultiCluster, MultiTenant and Hierarchical Kafka Messa...
Kafka Summit SF 2017 - MultiCluster, MultiTenant and Hierarchical Kafka Messa...
 
Versioned Triple Pattern Fragments
Versioned Triple Pattern FragmentsVersioned Triple Pattern Fragments
Versioned Triple Pattern Fragments
 
Real time data pipline with kafka streams
Real time data pipline with kafka streamsReal time data pipline with kafka streams
Real time data pipline with kafka streams
 

Similaire à Lecture 14 Caching And Tlbs

Implementation of page table
Implementation of page tableImplementation of page table
Implementation of page table
guestff64339
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
RohitPaul71
 
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
 

Similaire à Lecture 14 Caching And Tlbs (20)

Implementation of page table
Implementation of page tableImplementation of page table
Implementation of page table
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptx
 
Ppt
PptPpt
Ppt
 
Memory management
Memory managementMemory management
Memory management
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Vmfs
VmfsVmfs
Vmfs
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 
Concurrency, Performance, Parallelism
Concurrency, Performance, ParallelismConcurrency, Performance, Parallelism
Concurrency, Performance, Parallelism
 
Mapping Data Flows Perf Tuning April 2021
Mapping Data Flows Perf Tuning April 2021Mapping Data Flows Perf Tuning April 2021
Mapping Data Flows Perf Tuning April 2021
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Operating system 35 paging
Operating system 35 pagingOperating system 35 paging
Operating system 35 paging
 
Functional?
 Reactive? 
Why?
Functional?
 Reactive? 
Why?Functional?
 Reactive? 
Why?
Functional?
 Reactive? 
Why?
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Functional? Reactive? Why?
Functional? Reactive? Why?Functional? Reactive? Why?
Functional? Reactive? Why?
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
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
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Lecture 14 Caching And Tlbs

  • 1. Caching and TLBs Andy Wang Operating Systems COP 4610 / CGS 5765
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Caching Applied to Address Translation Virtual addresses Physical addresses Data reads or writes (untranslated) TLB Translation table In TLB
  • 15. Example of the TLB Content Valid, rw 4 0 Invalid - - Valid, rw 1 2 Control bits Physical page number (PPN) Virtual page number (VPN)
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Two-Way Associative Cache VPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN hash = =
  • 21. Two-Way Associative Cache VPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN hash = =
  • 22. Two-Way Associative Cache VPN If miss, translate and replace one of the entries VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN VPN PPN hash = =
  • 23.
  • 24. Fully Associative Cache VPN VPN PPN VPN PPN VPN PPN hash = = =
  • 25. Fully Associative Cache VPN VPN PPN VPN PPN VPN PPN hash = = =
  • 26. Fully Associative Cache VPN VPN PPN VPN PPN VPN PPN If miss, translate and replace one of the entries hash = = =
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Relationship Between TLB and HW Memory Caches Data reads or writes (untranslated) VA data VA data Virtually addressed cache TLB PA data PA data Physically addressed cache PA data PA data PA data PA data Translation tables
  • 33.