diff --git a/lectures/memory-hierarchies/slides.qmd b/lectures/memory-hierarchies/slides.qmd index c7518a89ab0eba2ec7a515e30bbd122c2e326f54..20446cf3d0a348fb726541134c7ed1ebab0ed591 100644 --- a/lectures/memory-hierarchies/slides.qmd +++ b/lectures/memory-hierarchies/slides.qmd @@ -283,17 +283,29 @@ T_{avg,s} &= H_1 T_1 + ((1-H_1)\cdot H_2)\cdot(T_1+T_2)\\ -## Unavailable data (1/2) +## If data is not available in the current memory level {.leftalign} -If data is not available in the current memory level + - register spilling - - register spilling (register -> cache) - - cache missing (cache -> main memory) - - page fault (main memory -> disk) +:::{.smaller} +_Register has to look for the data in the L1 cache_ +::: + + - cache miss + +:::{.smaller} +_The current cache has to fetch the data from the next cache or main memory_ +::: + - page fault +:::{.smaller} +_Data was not found in main memory and has to be loaded from disk_ +::: -## Unavailable data (2/2) + + +## Requesting unavailable data :::{.r-stack} @@ -310,18 +322,65 @@ If data is not available in the current memory level ::: +::::::::{.columns .leftalign} + +:::{.column width=50%} + +:::{.fragment width=100% fragment-index=2} + + - Sending request + +::: + +:::{.fragment width=100% fragment-index=3} + + - If needed, forward request until found + +::: + +::: + +:::{.column width=50%} + +:::{.fragment width=100% fragment-index=4} -## Available data (1/2) + - Load data into cache(s) -Techniques to provide data ahead of time +::: + +:::{.fragment width=100% fragment-index=5} + + - Process available data + +::: + +::: + +:::::::: + + +## Provide data which might be needed {.leftalign} - caching + +:::{.smaller} +_Keep data around which was needed once_ +::: + - prefetching + +:::{.smaller} +_Load data which might be needed soon (spatial or temporal proximity, heuristics)_ +::: + - branch prediction +:::{.smaller} +_Similar to prefetching, load data needed for different code paths_ +::: -## Available data (2/2) +## Use cached data :::{.r-stack} @@ -333,6 +392,32 @@ Techniques to provide data ahead of time ::: +::::::::{.columns .leftalign} + +:::{.column width=50%} + +:::{.fragment width=100% fragment-index=2} + + - Sending request + - Data is already present + +::: + +::: + +:::{.column width=50%} + +:::{.fragment width=100% fragment-index=3} + + - Load data into cache + - Process it + +::: + +::: + +:::::::: + # Memory hierarchy on Levante