Memory Hierarchy Flashcards

1
Q

What are the characteristics of Memory?

A
  • Location
  • Capacity
  • Unit of transfer
  • Access method
  • Performance
  • Organisation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Capacity normally expressed as?

A

Bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are three ways of expressing memory performance?

A
  • Access Time
  • Memory Cycle time
  • Transfer Rate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Access Time?

A

Time between presenting the address and getting the valid data (Stated as N clock) typically nanoseconds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Memory Cycle time

A

Time may be required for the memory to recover before next access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Transfer Rate?

A

Rate at which data can be moved - typically gigabytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the characteristics of physical memory?

A
  • Decay
  • Volatility
  • Erasable
  • Power consumption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What type of physical memory use semiconductors?

A
  • SRAM
  • DRAM
  • Flash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How did Core memory work?

A
  • Magnetic ring for each bit
  • Used high currents
  • 1-6 µs cycle time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does storage hierarchy looklike?

A
  • Registers
  • L1 Cache
  • L2 Cache
  • Main Memory
  • Disk cache
  • Disk, Flash/SSD
  • Optical
  • Tape
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is DRAM and how does it work?

A

Dynamic RAM
- Bits stored as charge in capacitors
- Charges leak so need refreshing even when powered
- Simpler construction
- Smaller per bit
- Less expensive
- Slower (6-60ns)
- Used in main RAM
- “switch” connects it to the read or write circuit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does DRAM refresh work?

A
  • Each bit discharges over time and is boosted back by the refresh
  • This is a disadvantage of DRAM - but density is very high
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the specs and characteristics of DDR5?

A
  • Approx. 2 x DDR4
  • Faster clocks (up to 4Ghz) -> more bandwidth
  • Two independent 32 bit channels
  • Some error correction built-in
  • Lower voltage (1.1V) -> 20% lower power use
  • Can burst read 64 bytes
  • Capacity up to 96GB DIMM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is SRAM and its characteristics?

A

Static RAM
- Bits sorted as on/off gates (using 4-6 transistors)
- No charges to leak, no refreshing needed when powered
- More complex construction - Larger per bit
- More expensive per MiB (100x)
- Faster (0.5 to 10ns)
- Good for Cache and embedded RAM
- Only used as main RAM on microcontrollers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is ROM?

A

Read Only Memory
- Permanent storage (Non-volatile)
- Hardware support library subroutines
- Systems programs (BIOS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do CPUs use for DIMMs?

A

Two 64 bit channels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How can increasing DDR4 DIMMs help?

A

4 can increase bandwidth and decrease latency to/form cache as accesses can be interleaved

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What type of errors can occur in memory?

A
  • DRAM can loose data (e.g. 25k failures per Mbit per billion hours)
  • Hard Failure (Permanent defect - most common)
  • Soft Error (Random, non-destructive as there is no permanent damage to memory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are Caches?

A
  • Caches are small blocks of fast SRAM located on CPU chip
  • The CPU needs data faster than DRAM can provide so Memory requests go there, not DRAM
20
Q

How does a cache operation work?

A
  • CPU reads a memory location
  • address goes to cache
  • If present, cache provides data (cache hit)
  • If not present, block read required from main RAM to cache (cache miss)
  • Then deliver data request by CPU
21
Q

What are the Cache Design parameters?

A
  • Size
  • Mapping function needed
  • Replacement Algorithm
  • Write Policy
  • Block Size
  • Number of Caches
22
Q

Why is it preferable to use smaller L1 cache than a bigger L2 cache?

A

Big caches have longer latency

23
Q

What is latency?

A

The time it takes for data to travel from one place to another

24
Q

How does RAM get shielded from the cores with cache?

A

Multiple cores usually share a large level 3 cache to shield RAM from the cores

25
Why is the Cache Mapping Function used?
- Needed because cache is smaller than main RAM - Blocks of cache are allocated to certain addresses - Simplest method -direct mapped - Most caches now associative
26
How are Cache misses avoided?
- Try to access consecutive bytes in a cache line - Align data to the cache line boundaries
27
How does Magnetic disks work?
- One head per side - Heads are joined and aligned - Aligned tracks on each platter from cylinders - Data is striped by cylinder (reduces head movement and increases speed) - Best value online storage
28
How is Data organised and formatted on a Magnetic disk?
- Concentric rings or tracks Gaps between tracks Reduce gap to increase capacity Same bits per track - Minimum block size is one sector - Tracks divided into sectors of 512B or 4KiB
29
What determines HDD speed?
- Seek time (Moving head to correct track) - Rotational latency (Waiting for data to rotate under head) - Access time = Seek + Latency - Transfer rate
30
What is on-disk cache?
- Used to store whole tracks and cache r/w - Acts as a buffer between disk
31
What is the Mean time between failures for hard disks?
114 years
32
What are the characteristics of SSDs?
- Non volatile NAND logic (Fast) or flash based - Fast access times - Near zero latency - Sequential read speed 500-7000 MiBs - Max about 18TiB at the moment - More shock resistant, silent - Lower power - Expensive per Gbyte compared to HD
33
What are SSD characteristics?
- Can only write approx millions of times - They need up to date firmware and drivers - A very full SSD can wear-out the remaining space faster
34
What is wear levelling?
Spreads the writes around so no one area is worn out
35
How fast is SATA?
600 MiB/s
36
What is the best SSD interface?
PCIe as it supports very long command queues
37
What is the specs of Blu-ray?
- Use 406nvm laser - 15-30GiB - Useful for offline storage/transfer - Can read at 70MiB/s
38
What are optical Jukeboxes?
- 100s TB per box (typically Blu-ray) - 6s disk change - 500 slots, 10 drivers
39
What is the specs of magnetic tape?
- Large 12TB to 36TB - Serial access but good for backups - Speed often quoted in GB/hour - Cheap per TByte
40
What is iSCSI?
Internet Small Computer System Interface - Uses tcp/ip over normal ethernet - typically uses isolated network - can use an offload processor card to save cpu time - allows remote and very flexible storage arrays
41
What is RAID 0 and how does it work?
Redundant array of independent disks - No redundancy - Data striped across all disks - Increase speed - Size is N * DiskSize
42
How does RAID 1 work?
- Mirrored Disks - Data is striped across disks - 2 copies of each stripe on separate disks - Read from either - Write to both - Size is size of one disk - Recovery is simple (swap fault disk and re-mirror with no down time) - Expensive
43
How does RAID 5 work?
- Parity striped across all disks - Round robin allocation for parity stripe - Size is (N-1)*SizeofDisk
44
How does RAID 6 work?
Can tolerate two disk failures therefore much more reliable Size is (N-2)*SizeofDisk
45
How does rebuilding work with RAID?
- When a drive fails, the system has to rebuild - It can take a long time but the system can still perform okay - Hot swap drives means no downtime - A "hot spare" drive is always in system for automatic rebuilds