Measuring - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Measuring

Description:

measurement and analysis of cache performance ... make caches write-back (and snoopy)? Placing/Finding a page. Want Full associatively ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 24
Provided by: MurrayP2
Category:
Tags: measuring | snoopy

less

Transcript and Presenter's Notes

Title: Measuring


1
Exploiting the Memory Hierarchy
Chapter 7 PH
2
Measuring Improving Cache Performance
  • measurement and analysis of cache performance
  • look at two different techniques for improving
    cache performance
  • adding associativity to the cache to reduce the
    miss rate
  • Use of multi-level caches to reduce the miss
    penalty

3
Cache Performance
assume write buffer stalls are insignificant and
that read and write penalties are the same
4
Reducing Cache misses by more flexible placement
of blocks
  • Fully associative caches allow blocks to be
    placed anywhere in the cache
  • Have to search every tag field for every memory
    access
  • Set associative cache allows blocks to be placed
    in a fixed number of locations in the cache
  • an n-way set associative cache allows a block to
    be placed in one of n locations in the cache

5
Fully Associate Cache
6
Associative Cache
  • All caches can be considered as being set
    associative
  • Increasing associatively tends to decrease the
    miss rate

7
Cache arrrangement
8
4-way set associate
9
Replacement Strategies
  • Random
  • Least recently used
  • Clock Scan
  • Predictive

10
Virtual Memory
  • main memory can act as a cache for secondary
    storage
  • motivation
  • Allow processes (running program) to use more
    memory than there is available
  • transparent to programmer
  • Allow more processes to run concurrently
  • non-active part of process reside in secondary
    storage
  • active portion of current process in cache

11
Virtual Memory
  • With multiple programs sharing memory have to
    deal with
  • program relocation
  • protection
  • Give each process its own (virtual) address space
  • When processes accesses memory
  • translate virtual address to physical address

12
Virtual Memory
13
Definitions
  • main concepts similar to caches however different
    terminology used
  • virtual memory block gt page
  • virtual memory miss gt page fault

14
Address Translation
15
Design Choices
  • page faults when a page not in memory then have
    to fetch it from disk
  • can take millions of cycles
  • minimise miss penalty
  • optimise page size (4KB to 64KB)
  • reduce page fault rate by
  • page replacement policy
  • high levels of associatively
  • make caches write-back (and snoopy)?

16
Placing/Finding a page
  • Want Full associatively
  • impractical to search all pages in memory
  • Use a page table to map virtual addresses to
    physical addresses
  • Each process has its own page table
  • Page tables reside in memory
  • reads/writes to main memory require two accesses
  • one to get page table entry
  • one to perform data transfer

17
Page Tables
18
Page Tables
  • Base address of current page table held in the
    page table register
  • A programs state defined by its
  • PC
  • Registers
  • Page table

19
TLBs
  • Translation-look aside Buffer
  • cache of page table mappings
  • Typical values for a TLB might be
  • TLB size 32 4096 entries
  • Block Size 1 2 page table entries
  • Hit time 0.5 1 clock cycles
  • Miss penalty 10 30 clock cycles
  • Miss rate 0.01 1

20
TLBs
21
TLBs and caches
22
Virtual Memory Protection
  • If a physical page is not pointed to from the
    page table then it can not be accessed
  • Need to prevent a process from changing its own
    page table
  • user and supervisor modes
  • write protect bit to stop writes to the page
    table
  • Mechanism to allow swaps between user and
    supervisor mode and vice versa

23
Some Actual CPUs
Write a Comment
User Comments (0)
About PowerShow.com