From 3c911dc56af870aeab3f3f56fdce4ea1445c8217 Mon Sep 17 00:00:00 2001 From: Dominik Zobel <zobel@dkrz.de> Date: Thu, 27 Jun 2024 12:40:36 +0200 Subject: [PATCH] More details on available and unavailable data slides --- lectures/memory-hierarchies/slides.qmd | 103 ++++++++++++++++++++++--- 1 file changed, 94 insertions(+), 9 deletions(-) diff --git a/lectures/memory-hierarchies/slides.qmd b/lectures/memory-hierarchies/slides.qmd index c7518a8..20446cf 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 -- GitLab