Skip to content

Commit ce0676a

Browse files
authored
Merge pull request #3140 from madeline-underwood/mem2
Memory subsystem with ASCT reviewed
2 parents e4e57df + c38d40e commit ce0676a

7 files changed

Lines changed: 44 additions & 46 deletions

File tree

content/learning-paths/servers-and-cloud-computing/memory-subsystem/_index.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ title: Characterize the memory subsystem of an Arm Linux system using ASCT
33

44
description: Use ASCT to measure cache latency, streaming bandwidth, and coherency latency on Arm Neoverse systems, and compare results across Graviton generations.
55

6-
draft: true
7-
cascade:
8-
draft: true
9-
106
minutes_to_complete: 60
117

128
who_is_this_for: This is an advanced topic for software developers and performance engineers who want to understand and characterize the CPU-side memory subsystem of Arm Linux systems.
@@ -19,9 +15,9 @@ learning_objectives:
1915
- Compare results across Arm systems and draw conclusions
2016

2117
prerequisites:
22-
- Two or more Arm Linux systems with root or sudo access. The examples use AWS Graviton2 and Graviton4 instances, but other systems are possible.
23-
- Arm System Characterization Tool (ASCT) installed on each system.
24-
- A good understanding of CPU memory subsystems, including cache hierarchies, cache lines, and DRAM in the memory hierarchy.
18+
- Two or more Arm Linux systems with root or sudo access. The examples use AWS Graviton2 and Graviton4 instances, but other systems are possible
19+
- Arm System Characterization Tool (ASCT) installed on each system
20+
- A good understanding of CPU memory subsystems, including cache hierarchies, cache lines, and DRAM in the memory hierarchy
2521

2622
author: Jason Andrews
2723

content/learning-paths/servers-and-cloud-computing/memory-subsystem/cache-hierarchy.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Understand the cache hierarchy
2+
title: Analyze Arm cache hierarchy and performance characteristics
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Cache levels and performance clifs
9+
## Cache levels and performance cliffs
1010

1111
Each memory access is satisfied by the closest level of the hierarchy that contains the requested data. If the data is not found in the private caches, the request falls through to the next cache level and eventually to DRAM. Each level trades capacity for speed: L1 is tiny but fast, L2 is larger but slower, and L3 (or a system-level cache) is the largest on-chip cache but has the highest latency. Understanding this hierarchy for your specific system tells you where performance "cliffs" will occur as your working set grows.
1212

@@ -78,9 +78,9 @@ When you access a single byte, the hardware fetches an entire 64-byte cache line
7878

7979
### Associativity and conflict misses
8080

81-
A 4-way set associative cache can hold 4 lines that map to the same set. If your access pattern happens to map many addresses to the same set, lines get evicted even though the cache isn't full. This is less likely with randomized pointer-chase patterns, but can still occur depending on address distribution and cache indexing but worth understanding.
81+
A 4-way set associative cache can hold 4 lines that map to the same set. If your access pattern happens to map many addresses to the same set, lines get evicted even though the cache isn't full. Conflict misses are less likely with randomized pointer-chase patterns, but can still occur depending on address distribution and cache indexing, making this concept worth understanding.
8282

83-
### Prefetching
83+
### Hardware prefetching and cache performance
8484

8585
Modern Arm cores have hardware prefetchers that detect sequential and strided access patterns. They pull data into the cache before the CPU requests it, which can mask latency for predictable patterns. The pointer-chase benchmark in the next section defeats prefetching by design, giving you the true hardware latency rather than the prefetcher-assisted latency.
8686

@@ -102,7 +102,7 @@ Compare your `sysfs` findings with the TRM. If the sizes differ, the SoC vendor
102102
Arm publishes TRMs on the [Arm Developer documentation portal](https://developer.arm.com/documentation/). Search for the specific core name (for example, "Neoverse N1 TRM" or "Neoverse V2 TRM") to find the detailed cache specifications.
103103
{{% /notice %}}
104104

105-
## What you've accomplished and what's next
105+
## What you've learned and what's next
106106

107107
In this section you:
108108
- Reviewed the cache hierarchy for Neoverse N1 (Graviton2) and Neoverse V2 (Graviton4)

content/learning-paths/servers-and-cloud-computing/memory-subsystem/comparative-analysis.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Compare systems and draw conclusions
2+
title: Compare Arm memory subsystem performance across systems
33
weight: 7
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Bringing it all together
9+
## Complete memory subsystem analysis workflow
1010

1111
You now have a complete set of memory subsystem measurements for each of your test systems. This section shows how to collect all results in one pass, compare systems using ASCT's built-in diff tool, and draw meaningful architectural conclusions.
1212

@@ -149,15 +149,15 @@ Collect the key measurements from each system into a comparison table:
149149

150150
The conclusions below are from running ASCT on AWS EC2 instances that are easily available for you to try so you can learn the process and learn how to think about the results. There are many more details that go into CPU microarchitecture and system design that are not covered here, but this is a good way to get an initial understanding of the memory system of an Arm Linux server.
151151

152-
### Latency
152+
### Latency analysis across generations
153153

154154
The latency measurements from `latency-sweep` reveal how each generation's cache hierarchy performs. L1 latency is similar across both generations (1.6 ns vs 1.4 ns) because L1 caches are designed for very low latency, so the small difference reflects clock speed rather than cache microarchitecture. L2 latency improves by 27% on Graviton4 (4.0 ns vs 5.4 ns): Neoverse V2 has a 2 MB private L2 compared to Neoverse N1's 1 MB, and despite the larger size, the improved cache pipeline delivers lower latency. LLC latency improves by 24% on Graviton4 (21.8 ns vs 28.8 ns) even though the L3 is only slightly larger (36 MB vs 32 MB), which reflects microarchitectural improvements in the Neoverse V2 cache interconnect. DRAM latency is higher on Graviton4 (114.6 ns vs 95.5 ns, +20%) because DDR5 trades slightly higher access latency for significantly more bandwidth per channel compared to DDR4.
155155

156-
### Loaded latency
156+
### Loaded latency comparison
157157

158158
The `loaded-latency` results reveal the latency-bandwidth tradeoff. At low load (~3000 NOPs), latency matches the idle DRAM latency from `latency-sweep` (96.7 ns for Graviton2, 115.1 ns for Graviton4), confirming the two benchmarks are consistent. The knee on Graviton2 occurs between 70 and 50 NOPs, where latency nearly doubles from 134 ns to 266 ns before climbing to 344 ns at saturation. On Graviton4 the knee occurs between 30 and 20 NOPs at a much higher bandwidth (~340 GB/s vs ~126 GB/s on Graviton2), and latency plateaus around 190–198 ns at saturation rather than continuing to climb, suggesting the DDR5 memory controllers handle queue saturation more gracefully. Despite Graviton4's higher idle DRAM latency, its latency at saturation is 43% lower than Graviton2's (197 ns vs 344 ns), making it the better choice for workloads that operate near memory bandwidth limits.
159159

160-
### Bandwidth
160+
### Bandwidth comparison across systems
161161

162162
Single-core bandwidth from `bandwidth-sweep` shows the throughput capacity at each cache level. L1 bandwidth doubles on Graviton4 (321 vs 159 GB/s, +101%), likely reflecting a combination of higher clock speed and microarchitectural throughput improvements in Neoverse V2. L2 bandwidth improves by 29% (95 vs 73 GB/s) due to the wider L2 fill path, and LLC bandwidth more than doubles (80 vs 36 GB/s, +123%), reflecting improvements in the interconnect and shared cache design. Single-core DRAM bandwidth improves by 77% (37 vs 21 GB/s) because Neoverse V2 supports more outstanding memory requests than Neoverse N1 and DDR5 provides more bandwidth per channel than DDR4.
163163

@@ -167,11 +167,11 @@ Peak bandwidth from `peak-bandwidth` shows the system-level memory controller ca
167167

168168
The credibility of this type of analysis comes from cross-validation. Check that:
169169

170-
1. Latency steps match cache sizes: the `latency-sweep` boundaries should align with the cache sizes reported by `sysfs` and the TRM.
171-
2. Bandwidth plateaus match cache sizes: the `bandwidth-sweep` should show transitions at the same data sizes that `latency-sweep` identified.
172-
3. Peak bandwidth matches documented limits: compare the "All Reads" figure from `peak-bandwidth` against the theoretical peak from `asct system-info`. A well-configured system typically achieves 85-95% of theoretical peak.
173-
4. Idle loaded latency matches unloaded latency: the lowest-load row from `loaded-latency` should be close to the DRAM latency from `latency-sweep`.
174-
5. Results are repeatable: run each benchmark at least twice. If results vary by more than 5%, investigate sources of noise (CPU frequency scaling, background processes).
170+
- Latency steps match cache sizes: the `latency-sweep` boundaries should align with the cache sizes reported by `sysfs` and the TRM.
171+
- Bandwidth plateaus match cache sizes: the `bandwidth-sweep` should show transitions at the same data sizes that `latency-sweep` identified.
172+
- Peak bandwidth matches documented limits: compare the "All Reads" figure from `peak-bandwidth` against the theoretical peak from `asct system-info`. A well-configured system typically achieves 85-95% of theoretical peak.
173+
- Idle loaded latency matches unloaded latency: the lowest-load row from `loaded-latency` should be close to the DRAM latency from `latency-sweep`.
174+
- Results are repeatable: run each benchmark at least twice. If results vary by more than 5%, investigate sources of noise (CPU frequency scaling, background processes).
175175

176176
{{% notice Tip %}}
177177
Check if your system allows you to control CPU frequency scaling during benchmarks for more consistent results:
@@ -184,18 +184,18 @@ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governo
184184

185185
The examples here used AWS Graviton instances, but the methodology works on any Arm Linux machine with a NUMA-enabled kernel. To adapt it:
186186

187-
1. Install ASCT on the target system following the [install guide](/install-guides/asct/).
188-
2. Run all memory benchmarks: `sudo asct run memory loaded-latency --format=csv --output-dir results_$(hostname)`
189-
3. Compare with previous systems: `asct diff results_new/ --baseline results_reference/`
190-
4. Cross-validate: check that latency boundaries, bandwidth plateaus, and peak numbers are consistent with each other and with the hardware documentation.
187+
- Install ASCT on the target system following the [install guide](/install-guides/asct/).
188+
- Run all memory benchmarks: `sudo asct run memory loaded-latency --format=csv --output-dir results_$(hostname)`
189+
- Compare with previous systems: `asct diff results_new/ --baseline results_reference/`
190+
- Cross-validate: check that latency boundaries, bandwidth plateaus, and peak numbers are consistent with each other and with the hardware documentation.
191191

192192

193-
## What you've accomplished
193+
## What you've learned
194194

195195
In this section you:
196196
- Identified the topology and cache hierarchy of Arm Linux systems using `sysfs` and `asct system-info`
197197
- Measured cache and memory latency with the ASCT `latency-sweep` benchmark
198198
- Measured single-core streaming bandwidth with `bandwidth-sweep`
199199
- Measured peak system bandwidth with `peak-bandwidth` and the latency-bandwidth tradeoff with `loaded-latency`
200200
- Compared Graviton2 and Graviton4 to understand how generational improvements in core microarchitecture and memory technology affect real-world performance
201-
- Developed a portable methodology that works on any Arm Linux system with a single command
201+
- Developed a portable methodology that works on any Arm Linux system with a single command

content/learning-paths/servers-and-cloud-computing/memory-subsystem/multicore-bandwidth.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Measure multi-core bandwidth and loaded latency
2+
title: Measure Arm multi-core memory bandwidth and loaded latency with ASCT
33
weight: 6
44

55
### FIXED, DO NOT MODIFY
@@ -19,7 +19,7 @@ ASCT includes two benchmarks that characterize multi-core memory behavior:
1919

2020
Both benchmarks depend on `latency-sweep` to determine the optimal data size for targeting DRAM. ASCT runs it automatically as a dependency.
2121

22-
## Peak bandwidth
22+
## Measure peak system memory bandwidth
2323

2424
The `peak-bandwidth` benchmark makes full use of all cores to measure the maximum system bandwidth. It tests multiple traffic patterns to show how the mix of reads and writes affects peak throughput.
2525

@@ -63,7 +63,7 @@ Graviton4 with DDR5 delivers roughly 2.7x the peak all-reads bandwidth of Gravit
6363

6464
Compare the "All Reads" figure with the theoretical peak bandwidth reported by `asct system-info` to see how close each system gets to its maximum. Well-configured systems typically achieve 85-95% of theoretical peak with all-read traffic.
6565

66-
## Loaded latency
66+
## Measure memory latency under bandwidth load
6767

6868
The `loaded-latency` benchmark measures how memory latency changes as other cores generate increasing bandwidth pressure. It pins a latency-measuring thread on the last core of the first NUMA node and uses the remaining cores to generate background memory traffic. The traffic intensity is controlled by interleaving memory reads with different numbers of no-operation (NOP) instructions. More NOPs means less bandwidth pressure.
6969

@@ -142,7 +142,7 @@ On Graviton4, the knee appears between 30 and 20 injected NOPs, where latency ju
142142

143143
Graviton4 has higher idle DRAM latency than Graviton2 (approximately 115 ns vs 96 ns), which is consistent with the `latency-sweep` results. Despite this higher baseline latency, Graviton4's knee occurs at a much higher absolute bandwidth (around 340 GB/s vs 126 GB/s), giving significantly more headroom for bandwidth-sensitive workloads before latency degrades.
144144

145-
## What you've accomplished and what's next
145+
## What you've learned and what's next
146146

147147
In this section you:
148148
- Measured peak system bandwidth across multiple traffic patterns with `peak-bandwidth`

content/learning-paths/servers-and-cloud-computing/memory-subsystem/pointer-chase-latency.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Measure cache and memory latency with a pointer chase
2+
title: Measure Arm cache and memory latency using ASCT pointer chase
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
@@ -8,7 +8,7 @@ layout: learningpathall
88

99
## The pointer-chase technique
1010

11-
Cache and memory latency is the single most important metric for characterizing a memory subsystem. The standard technique is a pointer chase, a linked list where each node points to the next, and the CPU must complete each load before it can issue the next one. This creates a chain of dependent loads that defeats both hardware prefetching and out-of-order execution, letting you measure the effective dependent-load latency for this access pattern at each level of the memory hierarchy.
11+
Cache and memory latency is the single most important metric for characterizing a memory subsystem. The standard technique is a pointer chase, a linked list where each node points to the next, and the CPU must complete each load before it can issue the next one. Making each load depend on the previous one creates a chain of dependent loads that defeats both hardware prefetching and out-of-order execution, letting you measure the effective dependent-load latency for this access pattern at each level of the memory hierarchy.
1212

1313
## Why pointer chasing works
1414

@@ -74,7 +74,7 @@ Latency sweep for Graviton4:
7474

7575
Your actual numbers will differ. The important pattern is the steps in latency as the working set exceeds each cache level.
7676

77-
## Interpret the results
77+
## Interpret cache latency measurements
7878

7979
Graviton2 uses Neoverse N1 cores with a 64 KB L1D, 1 MB private L2, and a 32 MB shared L3. DRAM is DDR4.
8080

@@ -117,7 +117,7 @@ You can view the full list of available benchmarks and their keywords with:
117117
asct list
118118
```
119119

120-
## What you've accomplished and what's next
120+
## What you've learned and what's next
121121

122122
In this section you:
123123
- Ran the ASCT `latency-sweep` benchmark to measure pointer-chase latency across the full cache hierarchy and DRAM

content/learning-paths/servers-and-cloud-computing/memory-subsystem/streaming-bandwidth.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Measure single-core streaming bandwidth
2+
title: Measure Arm single-core memory bandwidth with ASCT
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
@@ -52,7 +52,7 @@ Datasize Used Level Bandwidth [GB/s]
5252

5353
Look at the stepping pattern: high bandwidth for L1, a lower plateau for L2, a further drop at the LLC, and then the DRAM floor.
5454

55-
## Interpret the results
55+
## Interpret bandwidth benchmark results
5656

5757
The `bandwidth-sweep` benchmark reports the bandwidth at the optimal data size for each cache level, using the boundaries that `latency-sweep` identified.
5858

@@ -63,7 +63,7 @@ Key differences to look for between Graviton2 and Graviton4:
6363
- **LLC bandwidth**: Graviton4 more than doubles the LLC bandwidth of Graviton2, reflecting improvements in the interconnect and shared cache design on Neoverse V2.
6464
- **DRAM bandwidth (single core)**: Graviton4 achieves higher single-core DRAM throughput because Neoverse V2 supports more outstanding memory requests than Neoverse N1, and DDR5 provides more bandwidth per channel than DDR4.
6565

66-
### Bytes per cycle
66+
### Convert bandwidth to bytes per cycle
6767

6868
To convert GB/s to bytes per cycle, use your core's clock speed:
6969

@@ -87,11 +87,11 @@ To run all bandwidth benchmarks at once:
8787
sudo asct run bandwidth
8888
```
8989

90-
## What you've accomplished and what's next
90+
## What you've learned and what's next
9191

9292
In this section you:
9393
- Ran the ASCT `bandwidth-sweep` benchmark to measure single-core streaming bandwidth at each cache level
9494
- Observed bandwidth plateaus corresponding to L1, L2, LLC, and DRAM
9595
- Learned about additional ASCT benchmarks for peak and cross-NUMA bandwidth
9696

97-
The next section extends this to multi-core bandwidth, showing how shared resources like L3 and DRAM behave under contention.
97+
The next section extends this to multi-core bandwidth, showing how shared resources like L3 and DRAM behave under contention.

content/learning-paths/servers-and-cloud-computing/memory-subsystem/system-overview.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: Identify the system topology and configuration
2+
title: Identify Arm CPU topology, cache hierarchy, and NUMA configuration
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9+
## Memory subsystem impact on Arm server performance
10+
911
Memory behavior is one of the primary determinants of compute performance for memory-bound applications. The CPU-side memory subsystem, including caches, interconnects, and DRAM, directly impact performance. Understanding latency, streaming bandwidth, and how caches and cores share resources is essential for diagnosing bottlenecks and tuning software on Arm servers.
1012

1113
## Identify CPU, cache, and NUMA topology
@@ -241,13 +243,13 @@ On both systems, every core has its own unique L1d, L1i, and L2 index, so those
241243

242244
### Visualize the topology with hwloc
243245

244-
The `hwloc` package provides a visual representation. Install it using the package manager:
246+
The `hwloc` package provides a visual representation of the hardware topology, including CPU cores, cache hierarchies, and NUMA nodes. The graphical output makes it easier to understand how cores are organized and which caches they share. Install it using the package manager:
245247

246248
```bash
247249
sudo apt-get install -y hwloc
248250
```
249251

250-
Generate a graphical representation of the hierarchy:
252+
Generate a PNG diagram of the complete hardware hierarchy. The `hwloc-ls` command enumerates the system topology and formats it as a tree diagram showing cores, caches, and memory:
251253

252254
```bash
253255
hwloc-ls --of png > topology.png
@@ -357,11 +359,11 @@ Below is a summary of each system.
357359
| L3 (shared) | 32 MB | 36 MB |
358360
| DRAM type | DDR4 | DDR5 |
359361

360-
## What you've accomplished and what's next
362+
## What you've learned and what's next
361363

362364
In this section you:
363365
- Identified the CPU model, core count, and NUMA topology of your test systems
364366
- Explored the cache hierarchy and cluster layout using `lscpu`, `hwloc`, and `sysfs`
365367
- Built a reference table of system properties for later comparison
366368

367-
The next section dives deeper into the cache hierarchy and explains what each level does and why the architectural choices matter for performance.
369+
The next section dives deeper into the cache hierarchy and explains what each level does and why the architectural choices matter for performance.

0 commit comments

Comments
 (0)