Cache Memory - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Cache Memory

Description:

One possible replacement algorithm is a FIFO based one where the oldest cached data is replaced first. CPU Cache - Write Policies CPU writes data in cache (hit) ... – PowerPoint PPT presentation

Number of Views:56
Avg rating:3.0/5.0
Slides: 24
Provided by: SoraS3
Category:
Tags: cache | memory

less

Transcript and Presenter's Notes

Title: Cache Memory


1
Cache Memory
  • By Sean Hunter

2
What is Cache?
  • A computer memory with very short access time
    used for storage of frequently used instructions
    or data webster.com

3
Types of Cache
  • L1/L2/L3 Cache
  • RAM Cache
  • Disk Cache
  • Software Level Cache

4
(No Transcript)
5
L1/L2/L3 Cache (Cache Memory)
  • Cache closer to the CPU that stores recently
    accessed data from RAM
  • Holds instructions to be executed next and
    variables for the CPU

6
L2 Cache
COAST Cache on a Stick
7
Cache Memory Continued
  • Level 1 Cache is stored on the CPU
  • L2/L3 Cache stored near, but not on the CPU
  • L1/L2/L3 Cache is more expensive than RAM

8
(No Transcript)
9
Cache Memory Replacement Policies
  • CPU requests data from cached memory
  • Cache memory has data, sends to CPU (Hit)
  • RAM has data, sends to CPU (Miss)
  • Cache performance measured by hits/misses where
    the ideal algorithm has a ratio close to 1.

10
Replacement Policies
  • On a miss the data from RAM is loaded in to Cache
  • Due to the nature of most programs (Variables are
    accessed multiple times in the same program) this
    cached data will have a high chance of being
    accessed often.
  • One possible replacement algorithm is a FIFO
    based one where the oldest cached data is
    replaced first.

11
CPU Cache - Write Policies
  • CPU writes data in cache (hit)
  • Write-through Cache and RAM updated
  • Write-back Cache updated, RAM updated when new
    data is going to replace that data in cache
  • Dirty bit keeps track of if a part of cache has
    changed

12
CPU Cache - Write Policies
  • CPU writes but data not in cache (Miss)
  • Write-no-allocate RAM updated
  • Write-allocate RAM updated, data loaded into
    cache

13
CPU Cache SMP Problems
  • Multiprocessor systems have trouble with
    write-through and write-back
  • IE. One processor updates data cached by both
    processors
  • Possible Solutions
  • Cache only unshared memory
  • Update all cache simultaneously

14
RAM Cache
  • Same as Cache Memory or CPU Cache, except instead
    of the L1/L2 cache caching RAM, RAM caches data
    from the hard disk.
  • For example, Windows loads multiple required
    libraries for running in memory, but code isnt
    executed from them constantly.

15
Disk Cache
  • Like cache memory, disk cache holds data recently
    read or written to from a hard disk. This is to
    speed up subsequent reads from recently accessed
    data.
  • Most newer hard drives have around 8mb of cache
    memory.

16
(No Transcript)
17
Software Cache
  • Software also needs to cache data into RAM that
    it uses often however, more often than not,
    this data isnt directly from the hard disk.
  • The data software caches is often processed data
    from a file translated by the program into
    another data structure. The process of
    translating may take a long time, so the cache in
    RAM is used to speed up the rest of the programs
    run time.

18
Software Cache - Example
  • Games such as Half-Life and Unreal Tournament
    2004 have a loading time before each game where
    the map, models, sounds, and other important data
    are all loaded into RAM.
  • Example Website loading lots of data from an SQL
    server each page load may take a few seconds, but
    if the first load caches all the data, the load
    may only take a few milliseconds.

19
Software Cache - Example
  • Internet Explorer
  • History Keeps a cache of recently viewed
    websites for easy access
  • Cache Keeps images and other files on disk so
    websites load faster the second time you visit
    them. These files are updated when there is a
    newer version of them on the server, or the cache
    is cleared.

20
(No Transcript)
21
Interesting Facts
  • The first Celeron CPU had no caching, however it
    performed almost as fast as the PII with cache.
  • Because some chipsets couldnt cache more than
    the first 64mb of RAM a rumor was spread that
    Windows 98 could only use up to 64mb of RAM,
    however in reality it supports up to 2GB of RAM.
  • In these chipsets, adding more than 64MB of RAM
    decreased performance.

22
More interesting facts
  • Some motherboards ship with fake cache memory
    (Pictures are of fake cache memory) to both
    deceive the user and to sell cheaper non-cache
    motherboards without having to manufacture
    completely different motherboard designs.

23
References
  • http//searchstorage.techtarget.com/sDefinition/0,
    ,sid5_gci211730,00.html
  • http//searchstorage.techtarget.com/sDefinition/0,
    ,sid5_gci211963,00.html
  • http//www.karbosguide.com/hardware/module3b2.htm
  • http//arstechnica.com/paedia/c/caching/caching-1.
    html
  • http//www.gb.tomshardware.com/howto/01q1/010212/s
    ocket5-06.html
  • http//www.hardwaresite.net/wb.html
  • http//www.pcwebopedia.com/TERM/D/disk_cache.html
Write a Comment
User Comments (0)
About PowerShow.com