SlideShare a Scribd company logo
1 of 13
© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Cache Management
2© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
Cache Fundamentals
How's of Cache
Cache Organization
Cache Pitfalls
3© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Cache Fundamentals
Mismatch between the RAM & CPU speed
Transfer rate
Latency to access the RAM
Static Vs Dynamic RAM
Systems have Dynamic RAM, which is slower
Static RAM is fast but expensive
Small static RAM between CPU & Dynamic RAM
This is known as Cache
4© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
How's of Cache
Located inside the CPU
Copies most recently accessed data from the RAM
memory to the static memory
The goal is to make CPU access the memory
cache instead of accessing directly the RAM
memory
We call it a ‘cache miss’ if the data is not present in
the cache
The circuit called cache controller loads the data
into cache
5© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
How's of Cache ...
The CPU asks for the memory / data stored in
address ‘A’
Since contents are not in cache, would be fetched
from RAM
The cache controller loads the line (typically 64
bytes) starting at address ‘A’
The circuit called prefetcher loads more data
located after this line
Branch prediction since program is not always
sequential
6© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Cache Organization
Direct Mapping
Divide the memory as per the number of cache lines
Simplest configuration, requires less meta data
Higher chances of cache misses
Fully Associative
Any memory could be loaded into any cache line
Most efficient cache organization
Extremely complex control logic
7© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Cache Organization ...
Hybrid solution called set associative
Memory cache is divided in several blocks (sets)
containing ‘n’ lines each
With this, the memory from the single block can be
put into one of the ‘n’ cache lines in the set
8© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Direct Mapping
Line 1
Line 2
...
Line 8192
128KB
128KB
128
9© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Set Associative Cache
Line 1– Line 4
Line 5 – Line 8
...
Line 2048
128KB
128KB
128
10© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Cache Pitfalls
Stale data
May severely degrade the system performance if
the program is not cache local
11© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Linux Page Cache Basics
Accelerates many accesses to files on non
volatile storage
During reads / writes to disk, Linux stores data in
unused areas of memory, which acts as cache
free -m
12© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all have we learnt?
Cache Fundamentals
How's of Cache
Cache Organization
Cache Pitfalls
13© 2019 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

What's hot (20)

Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Understanding the BBB
Understanding the BBBUnderstanding the BBB
Understanding the BBB
 
BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 

Similar to Cache Management

Chapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzChapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzGiulianoRanauro
 
IRJET- A Futuristic Cache Replacement using Hybrid Regression
IRJET-  	  A Futuristic Cache Replacement using Hybrid RegressionIRJET-  	  A Futuristic Cache Replacement using Hybrid Regression
IRJET- A Futuristic Cache Replacement using Hybrid RegressionIRJET Journal
 
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...Paul Hofmann
 
RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...
RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...
RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...Redis Labs
 
ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxAnamRiaz31
 
Share point 2013’s distributed cache service 6.0 (1)
Share point 2013’s distributed cache service 6.0 (1)Share point 2013’s distributed cache service 6.0 (1)
Share point 2013’s distributed cache service 6.0 (1)Hexaware Technologies
 
S106195 cos-use cases-istanbul-v1902a
S106195 cos-use cases-istanbul-v1902aS106195 cos-use cases-istanbul-v1902a
S106195 cos-use cases-istanbul-v1902aTony Pearson
 
S104875 nightmares-dreams-spectrum-control-jburg-v1809h
S104875 nightmares-dreams-spectrum-control-jburg-v1809hS104875 nightmares-dreams-spectrum-control-jburg-v1809h
S104875 nightmares-dreams-spectrum-control-jburg-v1809hTony Pearson
 
Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018
Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018
Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018Amazon Web Services
 
Cloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptxCloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptxemanamin19
 
NVMe and Flash – Make Your Storage Great Again!
NVMe and Flash – Make Your Storage Great Again!NVMe and Flash – Make Your Storage Great Again!
NVMe and Flash – Make Your Storage Great Again!DataCore Software
 
Efektywna Witualizacja Citrix na macierzach dyskowych NetApp
Efektywna Witualizacja Citrix na macierzach dyskowych NetAppEfektywna Witualizacja Citrix na macierzach dyskowych NetApp
Efektywna Witualizacja Citrix na macierzach dyskowych NetAppPeter Ocasek
 
Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019
Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019
Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019confluent
 
From the trenches: scaling a large log management deployment
From the trenches: scaling a large log management deploymentFrom the trenches: scaling a large log management deployment
From the trenches: scaling a large log management deploymentFaithWestdorp
 
Distributing Data The Aerospike Way
Distributing Data The Aerospike WayDistributing Data The Aerospike Way
Distributing Data The Aerospike WayAerospike, Inc.
 

Similar to Cache Management (20)

ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
 
ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
 
Chapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzChapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatz
 
IRJET- A Futuristic Cache Replacement using Hybrid Regression
IRJET-  	  A Futuristic Cache Replacement using Hybrid RegressionIRJET-  	  A Futuristic Cache Replacement using Hybrid Regression
IRJET- A Futuristic Cache Replacement using Hybrid Regression
 
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
 
RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...
RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...
RedisConf18 - Auto-Scaling Redis Caches - Observability, Efficiency & Perform...
 
ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptx
 
Share point 2013’s distributed cache service 6.0 (1)
Share point 2013’s distributed cache service 6.0 (1)Share point 2013’s distributed cache service 6.0 (1)
Share point 2013’s distributed cache service 6.0 (1)
 
Cache memory presentation
Cache memory presentationCache memory presentation
Cache memory presentation
 
S106195 cos-use cases-istanbul-v1902a
S106195 cos-use cases-istanbul-v1902aS106195 cos-use cases-istanbul-v1902a
S106195 cos-use cases-istanbul-v1902a
 
S104875 nightmares-dreams-spectrum-control-jburg-v1809h
S104875 nightmares-dreams-spectrum-control-jburg-v1809hS104875 nightmares-dreams-spectrum-control-jburg-v1809h
S104875 nightmares-dreams-spectrum-control-jburg-v1809h
 
AIX Performance Tuning Session at STU2017
AIX Performance Tuning Session at STU2017AIX Performance Tuning Session at STU2017
AIX Performance Tuning Session at STU2017
 
Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018
Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018
Deep Dive on Amazon Neptune (DAT403) - AWS re:Invent 2018
 
Cloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptxCloud Computing 2023 - Lecture 07.pptx
Cloud Computing 2023 - Lecture 07.pptx
 
NVMe and Flash – Make Your Storage Great Again!
NVMe and Flash – Make Your Storage Great Again!NVMe and Flash – Make Your Storage Great Again!
NVMe and Flash – Make Your Storage Great Again!
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Efektywna Witualizacja Citrix na macierzach dyskowych NetApp
Efektywna Witualizacja Citrix na macierzach dyskowych NetAppEfektywna Witualizacja Citrix na macierzach dyskowych NetApp
Efektywna Witualizacja Citrix na macierzach dyskowych NetApp
 
Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019
Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019
Help, my Kafka is broken! (Emma Humber, IBM) Kafka Summit SF 2019
 
From the trenches: scaling a large log management deployment
From the trenches: scaling a large log management deploymentFrom the trenches: scaling a large log management deployment
From the trenches: scaling a large log management deployment
 
Distributing Data The Aerospike Way
Distributing Data The Aerospike WayDistributing Data The Aerospike Way
Distributing Data The Aerospike Way
 

More from SysPlay eLearning Academy for You (12)

Linux Internals Part - 3
Linux Internals Part - 3Linux Internals Part - 3
Linux Internals Part - 3
 
Linux Internals Part - 2
Linux Internals Part - 2Linux Internals Part - 2
Linux Internals Part - 2
 
Linux Internals Part - 1
Linux Internals Part - 1Linux Internals Part - 1
Linux Internals Part - 1
 
Kernel Timing Management
Kernel Timing ManagementKernel Timing Management
Kernel Timing Management
 
POSIX Threads
POSIX ThreadsPOSIX Threads
POSIX Threads
 
Introduction to BeagleBone Black
Introduction to BeagleBone BlackIntroduction to BeagleBone Black
Introduction to BeagleBone Black
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Serial Drivers
Serial DriversSerial Drivers
Serial Drivers
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
Linux System
Linux SystemLinux System
Linux System
 

Recently uploaded

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Recently uploaded (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Cache Management

  • 1. © 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Cache Management
  • 2. 2© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? Cache Fundamentals How's of Cache Cache Organization Cache Pitfalls
  • 3. 3© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Cache Fundamentals Mismatch between the RAM & CPU speed Transfer rate Latency to access the RAM Static Vs Dynamic RAM Systems have Dynamic RAM, which is slower Static RAM is fast but expensive Small static RAM between CPU & Dynamic RAM This is known as Cache
  • 4. 4© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. How's of Cache Located inside the CPU Copies most recently accessed data from the RAM memory to the static memory The goal is to make CPU access the memory cache instead of accessing directly the RAM memory We call it a ‘cache miss’ if the data is not present in the cache The circuit called cache controller loads the data into cache
  • 5. 5© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. How's of Cache ... The CPU asks for the memory / data stored in address ‘A’ Since contents are not in cache, would be fetched from RAM The cache controller loads the line (typically 64 bytes) starting at address ‘A’ The circuit called prefetcher loads more data located after this line Branch prediction since program is not always sequential
  • 6. 6© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Cache Organization Direct Mapping Divide the memory as per the number of cache lines Simplest configuration, requires less meta data Higher chances of cache misses Fully Associative Any memory could be loaded into any cache line Most efficient cache organization Extremely complex control logic
  • 7. 7© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Cache Organization ... Hybrid solution called set associative Memory cache is divided in several blocks (sets) containing ‘n’ lines each With this, the memory from the single block can be put into one of the ‘n’ cache lines in the set
  • 8. 8© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Direct Mapping Line 1 Line 2 ... Line 8192 128KB 128KB 128
  • 9. 9© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Set Associative Cache Line 1– Line 4 Line 5 – Line 8 ... Line 2048 128KB 128KB 128
  • 10. 10© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Cache Pitfalls Stale data May severely degrade the system performance if the program is not cache local
  • 11. 11© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Page Cache Basics Accelerates many accesses to files on non volatile storage During reads / writes to disk, Linux stores data in unused areas of memory, which acts as cache free -m
  • 12. 12© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? Cache Fundamentals How's of Cache Cache Organization Cache Pitfalls
  • 13. 13© 2019 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?