Title: Prefetching for Mobile Computers Using Shape Graphs
1Prefetching for Mobile Computers Using Shape
Graphs
- Kristian Kvilekval and Ambuj Singh
- University of California, Santa Barbara
2Prefetching for Mobile Applications
- Application on Mobile Computer
- Access remote store objects
- Periodic interruption
- Object Oriented Databases
- Distributed Object system
3Our Approach
- Code-based prefetching
- Prefetch only those objects accessed by the code
- Extract program access patterns
- Provide runtime system with future accesses
- Advantages
- Complex pointer-based structures
- Prefetches cold misses
- Good accuracy
4Capturing Access Pattern Statically
- Shape Analysis
- Represents runtime data structures at compile
time as graphs - Applications extracts properties of programs
- SynchronizationBogda99Ruf00
- ParallelizationCorbera99
- SafetyGhiya96Nurit98Wilhem00
5Basic Shape Analysis
- Graph
- Abstract locations (heap cells)
- Edges labeled with with field names
- Abstract interpretation
- Extend graph through field references
- Combine graphs when heap location is shared
6Example shape
class Connector Part a,b class Part
Connector left,right,up,down Material m
Supplier s int volume() weight0 while
(part) weight(part.material.density
part.volume()) partpart.right.b
7Construction of Shape Graphs
x
8Construction of Shape Graphs
x.f s
F
9Construction of Shape Graphs
x.f s t x.f.g
F
G
10Construction of Shape Graphs
x.f s x.f.g t x x.n
N
F
?
G
11Construction of Shape Graphs
x.f s x.f.g t if (x ! null) x x.n
12Combining Shape Graphs
x y
13Combining Shape Graphs
14Unification of Shape Graphs
N
F
J
G
K
15Shape Analysis Algorithm
- ? methods Interpret basic blocks
- Create shapes for basic blocks
- Run until fixed-point is reached
- Propagate in static callgraph
16Static Call Graphs
main
Static representation of calls
m2
m3
m4
m3 a.f s o.m4(a) Class C m4(F f)
Unify(a,f)
f
17Call Graphs
m1
- Propagate bottom up
- Merge polymorphic calls
- Recursive Calls
- Fixed point
- Merge SCCRuf00
m2
B.m4
m3
m4
D1.m4
D2.m4
m1
m2
m1
18Prefetching with shape graphs
- Compile Time
- Generate shapes for method references
- Self, arguments, and global variables
- Label shape edges with earliest access
- Annotate programs to pass visible references and
method ID to runtime - Runtime
- Interpret shape graph on the actual object graph
19Prefetching with Shape Graphs
N5
a1
N
N
o10
o45
o610
J10
F10
F
J
J
o210
o515
a2
a4
K
G5
K10
o320
a5
a3
(o1,a1) (o4,a1) (o2,a2) (o6,a1) (o5,a4)
(o3,a5)
20Evaluation
- Java specjvm benchmarks
- Track all objects accesses
- Disconnects
- Poisson/Gaussian
- Duration 500
- Prefetching
- Interval 2
- Lookahead 512
- Cache 2048
Cache
jess Expert System
db Address DB
mtrt ray tracer
OO7 OO database
21mtrt cold-misses
22OO7 all cold-misses
23OO7 Startup cold-misses
24Benchmarks
Benchmark Initialized INFcold PREcold Time INF Time PRE
jess 11196 1182 27 328K 310K
Db 528 51 1 11002 3982
mtrt 179527 2498 3 1803K 1222K
OO7 228535 107550 1 3133K 2547K
Infinite lookahead with infinite cache
25Effect of Varying Disconnect Cost
26Effect of Varying Cache Size
27Prefetcher Overhead
benchmark jess mtrt
objects 26462 209630
cache 1024 2048 4096 10240 20480 40960
Discards cache 34386 10941 6707 24132 21073 30748
Discards pre 73350 5335 1243 48432 16496 13213
Jess \ Lookahead 0 64 256 512 1024 2048
Runtime 401K 375K 358K 357K 346K 346K
Discards 0 10K 6K 7K 7K 8.4K
wait 0 79 82 83 83 83
28Future Extensions
- Accuracy and Overhead
- Dynamic runtime values (hashtable)
- Find high-payoff points (callgraph,history)
- Balancing prefetching with
- cache, bandwidth, and power.
- Tuning prefetcher to link stability
- And phase behavior of programs
- Extend shape analysis to work at runtime
- Apply to non-mobile systems.
29Similar Approaches
- Classfiles Krintz98
- Earliest method invocation through callgraph and
block analysis - Slices for multithreaded processors
Collins01Zilles01 - Preexecute data operations ahead of program
- I/O extractionMitra00
- Extract I/O related variables and execute in
separate thread.
30Conclusions
- Code-based prefetching technique for complex
pointer-based structures - Able to prefetch cold misses
- Good accuracy
- kris_at_cs.ucsb.edu
31New Style Applications
Disconnections Sharing Distribution Network-topolo
gy
Mobile Collaborative Serverless Dynamic
32Collaborative Mobile Applications
- Calendar, Whiteboard, Bibliographer
- Cooperative Web cache
- Emergency services
- Games
- Construction/Filming/Concerts
33Prefetching for availability
- File Systems
- Explicit or Structured
- Coda Kistler92, Ficus/Rumor/Roam Guy98
- Prediction (SEERKeunning97)
- Cluster based on file opens
- Databases
- Attributes Phatak99
- Checkout Holliday00
- Object BasesKnafla99
- Access patterns applied to object structure
34Mobile Model
Groups
Wireless
Portable