2.4. Computer System Structures - Storage Structure.pptx

Download Report

Transcript 2.4. Computer System Structures - Storage Structure.pptx

Computer System Structures
Storage
• Storage Structure
• Storage Hierarchy
• Different storage examples
• Cache
• Magnetic Disks
Storage Hierarchy
Speed
Size
Cost
Volatile (variable,
non stable)
The main differences
among the various
storage systems lie in
speed, cost, size,
and volatility.
Non Volatile
(permanent, stable)
Storage Device hierarchy
Performance of various levels of
storage
Registers
General Purpose Registers
•
Registers that are built into the CPU have the fastest access for CPU instructions.
•
Main memory and the registers built into the processor itself are the only storage that
the CPU can access directly.
Main Memory
(RAM - random-access memory)
• Computer programs must be in RAM to be executed.
• Ideally, we want the programs and data to reside in main memory permanently.
• This arrangement is not possible for the following two reasons:
• Main memory is usually too small to store all needed programs and data permanently.
• Main memory is a volatile storage device that loses its contents when power is turned off or
otherwise lost.
• Main memory is the only large storage area that the processor can access directly
and fast.
Electronic disk. Secondary Storage
An electronic disk can be designed to be either volatile or nonvolatile.
•
•
One of the forms of electronic disk is flash memory
Another form is a combination of DRAM and magnetic disk. Normally you use DRAM as a disk.
When the power is interrupted then the information is transferred to the magnetic disk.
•
Secondary Storage allows to hold large quantities of data permanently.
•
The most common secondary-storage device is a magnetic disk, which provides
storage of both programs and data.
Magnetic tape was used as an early secondary-storage
medium.
•
•
•
it is relatively permanent and can hold large quantities
of data
its access time is slow than memory or magnetic disk
access, random access to magnetic tape is about a
thousand times slower than random access to
magnetic disk
Tapes are used mainly for backup purposes or as a
medium for transferring information from one system to
another
Cache Memory
• Registers that are built into the CPU are generally accessible within one cycle of
the CPU clock (very fast).
• The main memory access is done via a transaction on the memory bus and is
much slower,
•
in which case the processor normally needs to stall, since it does not have the data
required to complete the instruction that it is executing.
• This situation is intolerable because of the frequency of memory accesses.
• The remedy is to add fast memory between the CPU and main memory.
• A memory buffer used to accommodate a speed differential, called a cache.
Main Memory Caching
Main Memory
Load preliminarily
50ns
Cache Memory (set of fast registers)
5 ns
Normal Load
50ns
Register
Hard Disk Caching
• Main memory can be viewed as a fast cache for secondary storage, since data in secondary
storage must be copied into main memory for use, and data must be in main memory before
being moved to secondary storage for safekeeping.
• Disk controllers usually have a built-in cache. Data transfer at the disk drive happens between
the cache and the disk surface, and data transfer to the host, at fast electronic speeds, occurs
between the cache and the host controller.
Main Memory
HDD Cache in RAM
Write, Read to cache
Normal Write, Read
50ns
0.010 ms
0.010 ms
HDD Cache in Controller
10 ms
The difference between a buffer and a
cache is that
• a buffer may hold the only existing copy
of a data item
• a cache holds a copy on faster storage
of an item that resides elsewhere.
Hard
Disk
•
Caching and buffering are distinct
functions,
•
but sometimes a region of memory
can be used for both purposes.
Caching
The movement of information between levels of a storage hierarchy may be either explicit or implicit,
depending on the hardware design and the controlling operating-system software.
•
•
For instance, data transfer from cache to CPU and registers is usually a hardware function, with
no operating-system intervention.
On the other hand, transfer of data from disk to memory is usually controlled by the operating
system.
Processor Caches
 Level1 cache – Inside each core (not shared)
 Level2 cache – inside chip – shared by processor cores
 Level3 cache – outside chip – shared by processor chips.
Magnetic Disks
Disk access time (transfer rate) is an average of the time between initiating a request
and obtaining the first data character. It includes
•
•
the command
Hard processing,
Disk important parameters accessible by API
the average seek or random-access time (moving the read/write head to the required
Cylinder
Track
Head
Sector
track)
They fully
define where
is your
HDD.
• and the average
latency
(rotation
ofdata
diskontothethe
required sector).
This specification must be given as an average, because seek times and latency can vary
depending on the current position of the head and platter.