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

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.pptxHampshireHUG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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 Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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 AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Recently uploaded (20)

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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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?