12
Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer Engineering Oklahoma State University

Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Embed Size (px)

Citation preview

Page 1: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

OS Interaction with Cache Memories

Dr. Sohum Sohoni

School of Electrical and Computer Engineering

Oklahoma State University

Page 2: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

Outline Technically ‘light’ talk- broad audience

Background terminology and one example of current work

Wild predictions about the future

Many thanks to the National Science Foundation CNS #0720741

Any views presented here are my own, and not reflective of the NSF’s views and policies

Page 3: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

Some Terminology CPU Caches

Miss rates

Locality

Prefetching

Context Switches

‘state’

Working set or memory footprint

Process queue

Page 4: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

Goal of Memory Hierarchy Low latency, high bandwidth, high capacity, low cost

CPU L1 CacheL2 Cache

Main Memory

(System DRAM)

3GHz

Extremely fast bus

2 cycles

16 KB

Slower bus

2+7 = 9 cycles

512 KB

Much slower

bus

300 cycles

512 MB

Page 5: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

What Happens in a Context Switch

Current process ‘state’ is saved Scheduler is invoked Next process is ‘brought in’ TLB’s are flushed L1 cache may be flushed New process executes for its time slice Interrupt, state saved, scheduler …

Effective locality gets wiped out

Page 6: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

Effect of MultiProgramming

10ms 20ms 30ms 40ms 50ms 60ms

CPUCPUCPUCPUCPUCPUCPUCPUCPU

I/OI/OI/O

10ms 20ms 30ms 40ms 50ms 60ms

CPUI/OCPUCPUI/OCPUI/OCPU

Mem

ory

p

ress

ure

Mem

ory

p

ress

ure

Page 7: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

Problem with MultiProgramming Increasing multi-programming increases cache miss

rates

Loss of locality of reference

Diminishing returns from multi-programming

Eventual thrashing

k

Page 8: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

Out of Context Prefetching Reduce the negative effect of multi-programming on

CPU cache performance

Predict future context switches

Prefetch the working set of the next process

Mem

ory

P

ress

ure

Context Switch!

Time

Prefetch

Page 9: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE 9

OOC Prefetching Picture

CPU

L1

L2

Main memory

OOC Prefetch

Page 10: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE 10

Context Switch Prediction

35

40

45

50

55

60

65

70

75

80

Series1

Prediction Rate %

Page 11: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE 11

Miss Rate Improvement

mcf

bzip

2gc

c

sopl

ex

xala

ncbm

kas

tar

sphi

nx3

povr

ay

h264

ref

0%

10%

20%

30%

40%

50%

60%

Mis

s R

ate

Im

pro

ve

me

nt

Page 12: Computer Architecture Evaluation, Simulation and Research OSU ECE OS Interaction with Cache Memories Dr. Sohum Sohoni School of Electrical and Computer

Computer Architecture Evaluation, Simulation and ResearchOSU ECE

THANK YOU!

Q AND A