SlideShare a Scribd company logo
1 of 38
Disk-based Storage
Oct. 23, 2008
Topics
 Storage technologies and trends
 Locality of reference
 Caching in the memory hierarchy
lecture-17.ppt
15-213
“The course that gives CMU its Zip!”
2 15-213, F’08
Announcements
Exam next Thursday
 style like exam #1: in class, open book/notes, no electronics
3 15-213, F’08
Disk-based storage in computers
 Memory/storage hierarchy
 Combining many technologies to balance costs/benefits
 Recall the memory hierarchy and virtual memory lectures
4 15-213, F’08
Memory/storage hierarchies
 Balancing performance with cost
 Small memories are fast but expensive
 Large memories are slow but cheap
 Exploit locality to get the best of both worlds
 locality = re-use/nearness of accesses
 allows most accesses to use small, fast memory
Capacity
Performance
5 15-213, F’08
An Example Memory Hierarchy
registers
on-chip L1
cache (SRAM)
main memory
(DRAM)
local secondary storage
(local disks)
Larger,
slower,
and
cheaper
(per byte)
storage
devices
remote secondary storage
(tapes, distributed file systems, Web servers)
Local disks hold files
retrieved from disks on
remote network servers.
Main memory holds disk
blocks retrieved from local
disks.
off-chip L2
cache (SRAM)
L1 cache holds cache lines retrieved
from the L2 cache memory.
CPU registers hold words retrieved
from L1 cache.
L2 cache holds cache lines
retrieved from main memory.
L0:
L1:
L2:
L3:
L4:
L5:
Smaller,
faster,
and
costlier
(per byte)
storage
devices
From lecture-9.ppt
6 15-213, F’08
Page Faults
A page fault is caused by a reference to a VM word that is not in
physical (main) memory
 Example: An instruction references a word contained in VP 3, a miss
that triggers a page fault exception
null
null
Memory resident
page table
(DRAM)
Physical memory
(DRAM)
VP 7
VP 4
Virtual memory
(disk)
Valid
0
1
0
1
0
1
0
1
Physical page
number or
disk address
PTE 0
PTE 7
PP 0
VP 2
VP 1
PP 3
VP 1
VP 2
VP 4
VP 6
VP 7
Virtual address
VP 3
From lecture-14.ppt
7 15-213, F’08
Disk-based storage in computers
 Memory/storage hierarchy
 Combining many technologies to balance costs/benefits
 Recall the memory hierarchy and virtual memory lectures
 Persistence
 Storing data for lengthy periods of time
 DRAM/SRAM is “volatile”: contents lost if power lost
 Disks are “non-volatile”: contents survive power outages
 To be useful, it must also be possible to find it again later
 this brings in many interesting data organization, consistency,
and management issues
 take 18-746/15-746 Storage Systems 
 we’ll talk a bit about file systems next
8 15-213, F’08
What’s Inside A Disk Drive?
Spindle
Arm
Actuator
Platters
Electronics
SCSI
connector
Image courtesy of Seagate Technology
9 15-213, F’08
Disk Electronics
• Connect to disk
• Control processor
• Cache memory
• Control ASIC
• Connect to motor
Just like a small
computer – processor,
memory, network iface
10 15-213, F’08
Disk “Geometry”
Disks contain platters, each with two surfaces
Each surface organized in concentric rings called tracks
Each track consists of sectors separated by gaps
spindle
surface
tracks
track k
sectors
gaps
11 15-213, F’08
Disk Geometry (Muliple-Platter View)
Aligned tracks form a cylinder
surface 0
surface 1
surface 2
surface 3
surface 4
surface 5
cylinder k
spindle
platter 0
platter 1
platter 2
12 15-213, F’08
Disk Structure
Read/Write Head
Upper Surface
Platter
Lower Surface
Cylinder
Track
Sector
Arm
Actuator
13 15-213, F’08
Disk Operation (Single-Platter View)
The disk
surface
spins at a fixed
rotational rate
spindle
By moving radially, the arm
can position the read/write
head over any track
The read/write head
is attached to the end
of the arm and flies over
the disk surface on
a thin cushion of air
spindle
spindle
spindle
spindle
14 15-213, F’08
Disk Operation (Multi-Platter View)
arm
read/write heads
move in unison
from cylinder to cylinder
spindle
15 15-213, F’08
Tracks divided into sectors
Disk Structure - top view of single
platter
Surface organized into tracks
16 15-213, F’08
Disk Access
Head in position above a track
17 15-213, F’08
Disk Access
Rotation is counter-clockwise
18 15-213, F’08
Disk Access – Read
About to read blue sector
19 15-213, F’08
Disk Access – Read
After BLUE read
After reading blue sector
20 15-213, F’08
Disk Access – Read
After BLUE read
Red request scheduled next
21 15-213, F’08
Disk Access – Seek
After BLUE read Seek for RED
Seek to red’s track
22 15-213, F’08
Disk Access – Rotational Latency
After BLUE read Seek for RED Rotational latency
Wait for red sector to rotate around
23 15-213, F’08
Disk Access – Read
After BLUE read Seek for RED Rotational latency After RED read
Complete read of red
24 15-213, F’08
Disk Access – Service Time
Components
After BLUE read Seek for RED Rotational latency After RED read
Seek
Rotational Latency
Data Transfer
25 15-213, F’08
Disk Access Time
Average time to access a specific sector approximated by:
 Taccess = Tavg seek + Tavg rotation + Tavg transfer
Seek time (Tavg seek)
 Time to position heads over cylinder containing target sector
 Typical Tavg seek = 3-5 ms
Rotational latency (Tavg rotation)
 Time waiting for first bit of target sector to pass under r/w head
 Tavg rotation = 1/2 x 1/RPMs x 60 sec/1 min
 e.g., 3ms for 10,000 RPM disk
Transfer time (Tavg transfer)
 Time to read the bits in the target sector
 Tavg transfer = 1/RPM x 1/(avg # sectors/track) x 60 secs/1 min
 e.g., 0.006ms for 10,000 RPM disk with 1,000 sectors/track
 given 512-byte sectors, ~85 MB/s data transfer rate
26 15-213, F’08
Disk Access Time Example
Given:
 Rotational rate = 7,200 RPM
 Average seek time = 5 ms
 Avg # sectors/track = 1000
Derived average time to access random sector:
 Tavg rotation = 1/2 x (60 secs/7200 RPM) x 1000 ms/sec = 4 ms
 Tavg transfer = 60/7200 RPM x 1/400 secs/track x 1000 ms/sec =
0.008 ms
 Taccess = 5 ms + 4 ms + 0.008 ms = 9.008 ms
 Time to second sector: 0.008 ms
Important points:
 Access time dominated by seek time and rotational latency
 First bit in a sector is the most expensive, the rest are free
 SRAM access time is about 4 ns/doubleword, DRAM about 60 ns
 ~100,000 times longer to access a word on disk than in DRAM
27 15-213, F’08
Disk storage as array of blocks
OS’s view of storage device
(as exposed by SCSI or IDE/ATA protocols)
 Common “logical block” size: 512 bytes
 Number of blocks: device capacity / block size
 Common OS-to-storage requests defined by few fields
 R/W, block #, # of blocks, memory source/dest
6
5 7 12 23 …
…
28 15-213, F’08
Page Faults
A page fault is caused by a reference to a VM word that is not in
physical (main) memory
 Example: An instruction references a word contained in VP 3, a miss
that triggers a page fault exception
null
null
Memory resident
page table
(DRAM)
Physical memory
(DRAM)
VP 7
VP 4
Virtual memory
(disk)
Valid
0
1
0
1
0
1
0
1
Physical page
number or
disk address
PTE 0
PTE 7
PP 0
VP 2
VP 1
PP 3
VP 1
VP 2
VP 4
VP 6
VP 7
Virtual address
VP 3
From lecture-14.ppt
“logical block” number can be
remembered in page table to
identify disk location for pages
not resident in main memory
29 15-213, F’08
In device, “blocks” mapped to physical store
Disk Sector
(usually same size as block)
30 15-213, F’08
Physical sectors of a single-surface
disk
31 15-213, F’08
LBN-to-physical for a single-surface
disk
10
9
8
7
6
5
4
3
2
1
0
12
13
11
22
18
16 17
19
20
21
24
15
14
23
28 29
30
31
33
32
34
25
26
27
35
41
42
43
44
46
45
36
37
38
40
39
4
7
32 15-213, F’08
Disk Capacity
Capacity: maximum number of bits that can be stored
 Vendors express capacity in units of gigabytes (GB), where
1 GB = 109 Bytes (Lawsuit pending! Claims deceptive advertising)
Capacity is determined by these technology factors:
 Recording density (bits/in): number of bits that can be squeezed
into a 1 inch linear segment of a track
 Track density (tracks/in): number of tracks that can be squeezed
into a 1 inch radial segment
 Areal density (bits/in2): product of recording and track density
33 15-213, F’08
Computing Disk Capacity
Capacity = (# bytes/sector) x (avg. # sectors/track) x
(# tracks/surface) x (# surfaces/platter) x
(# platters/disk)
Example:
 512 bytes/sector
 1000 sectors/track (on average)
 20,000 tracks/surface
 2 surfaces/platter
 5 platters/disk
Capacity = 512 x 1000 x 80000 x 2 x 5
= 409,600,000,000
= 409.6 GB
34 15-213, F’08
Looking back at the hardware
main
memory
bus interface
ALU
register file
CPU chip
35 15-213, F’08
Connecting I/O devices: the I/O Bus
main
memory
I/O
bridge
bus interface
ALU
register file
CPU chip
system bus memory bus
USB
controller
mousekeyboard
graphics
adapter
monitor
disk
controller
disk
I/O bus Expansion slots for
other devices such
as network adapters
36 15-213, F’08
Reading from disk (1)
main
memory
ALU
register file
CPU chip
disk
controller
graphics
adapter
USB
controller
mousekeyboard monitor
disk
I/O bus
bus interface
CPU initiates a disk read by writing a READ
command, logical block number, number of
blocks, and destination memory address to a
port (address) associated with disk controller
37 15-213, F’08
Reading from disk (2)
main
memory
ALU
register file
CPU chip
disk
controller
graphics
adapter
USB
controller
mousekeyboard monitor
disk
I/O bus
bus interface
Disk controller reads the sectors and
performs a direct memory access (DMA)
transfer into main memory
38 15-213, F’08
Reading from disk (3)
main
memory
ALU
register file
CPU chip
disk
controller
graphics
adapter
USB
controller
mousekeyboard monitor
disk
I/O bus
bus interface
When the DMA transfer completes, the
disk controller notifies the CPU with an
interrupt (i.e., asserts a special “interrupt”
pin on the CPU)

More Related Content

Similar to lecture-17.ppt (20)

Nachos 2
Nachos 2Nachos 2
Nachos 2
 
Ch10
Ch10Ch10
Ch10
 
Ch12
Ch12Ch12
Ch12
 
Storage structure1
Storage structure1Storage structure1
Storage structure1
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
 
File000121
File000121File000121
File000121
 
Kavi
KaviKavi
Kavi
 
Kavi
KaviKavi
Kavi
 
CH10.pdf
CH10.pdfCH10.pdf
CH10.pdf
 
L21-Introduction-to-IO.ppt
L21-Introduction-to-IO.pptL21-Introduction-to-IO.ppt
L21-Introduction-to-IO.ppt
 
Disk Management.ppt
Disk Management.pptDisk Management.ppt
Disk Management.ppt
 
DB_ch11
DB_ch11DB_ch11
DB_ch11
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
What is the future of disk drives?
What is the future of disk drives?What is the future of disk drives?
What is the future of disk drives?
 
Db
DbDb
Db
 
db
dbdb
db
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
OSCh14
OSCh14OSCh14
OSCh14
 
OS_Ch14
OS_Ch14OS_Ch14
OS_Ch14
 
Ch14 OS
Ch14 OSCh14 OS
Ch14 OS
 

More from AshokRachapalli1

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptxAshokRachapalli1
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...AshokRachapalli1
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptxAshokRachapalli1
 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxAshokRachapalli1
 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxAshokRachapalli1
 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptxAshokRachapalli1
 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptxAshokRachapalli1
 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxAshokRachapalli1
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptxAshokRachapalli1
 

More from AshokRachapalli1 (20)

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
 
Chapter5 (1).ppt
Chapter5 (1).pptChapter5 (1).ppt
Chapter5 (1).ppt
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptx
 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptx
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
lec16-memory.ppt
lec16-memory.pptlec16-memory.ppt
lec16-memory.ppt
 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptx
 
instruction format.pptx
instruction format.pptxinstruction format.pptx
instruction format.pptx
 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptx
 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptx
 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptx
 
Flow Control.pptx
Flow Control.pptxFlow Control.pptx
Flow Control.pptx
 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
 
intro22.ppt
intro22.pptintro22.ppt
intro22.ppt
 
osi.ppt
osi.pptosi.ppt
osi.ppt
 
switching.pptx
switching.pptxswitching.pptx
switching.pptx
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

lecture-17.ppt

  • 1. Disk-based Storage Oct. 23, 2008 Topics  Storage technologies and trends  Locality of reference  Caching in the memory hierarchy lecture-17.ppt 15-213 “The course that gives CMU its Zip!”
  • 2. 2 15-213, F’08 Announcements Exam next Thursday  style like exam #1: in class, open book/notes, no electronics
  • 3. 3 15-213, F’08 Disk-based storage in computers  Memory/storage hierarchy  Combining many technologies to balance costs/benefits  Recall the memory hierarchy and virtual memory lectures
  • 4. 4 15-213, F’08 Memory/storage hierarchies  Balancing performance with cost  Small memories are fast but expensive  Large memories are slow but cheap  Exploit locality to get the best of both worlds  locality = re-use/nearness of accesses  allows most accesses to use small, fast memory Capacity Performance
  • 5. 5 15-213, F’08 An Example Memory Hierarchy registers on-chip L1 cache (SRAM) main memory (DRAM) local secondary storage (local disks) Larger, slower, and cheaper (per byte) storage devices remote secondary storage (tapes, distributed file systems, Web servers) Local disks hold files retrieved from disks on remote network servers. Main memory holds disk blocks retrieved from local disks. off-chip L2 cache (SRAM) L1 cache holds cache lines retrieved from the L2 cache memory. CPU registers hold words retrieved from L1 cache. L2 cache holds cache lines retrieved from main memory. L0: L1: L2: L3: L4: L5: Smaller, faster, and costlier (per byte) storage devices From lecture-9.ppt
  • 6. 6 15-213, F’08 Page Faults A page fault is caused by a reference to a VM word that is not in physical (main) memory  Example: An instruction references a word contained in VP 3, a miss that triggers a page fault exception null null Memory resident page table (DRAM) Physical memory (DRAM) VP 7 VP 4 Virtual memory (disk) Valid 0 1 0 1 0 1 0 1 Physical page number or disk address PTE 0 PTE 7 PP 0 VP 2 VP 1 PP 3 VP 1 VP 2 VP 4 VP 6 VP 7 Virtual address VP 3 From lecture-14.ppt
  • 7. 7 15-213, F’08 Disk-based storage in computers  Memory/storage hierarchy  Combining many technologies to balance costs/benefits  Recall the memory hierarchy and virtual memory lectures  Persistence  Storing data for lengthy periods of time  DRAM/SRAM is “volatile”: contents lost if power lost  Disks are “non-volatile”: contents survive power outages  To be useful, it must also be possible to find it again later  this brings in many interesting data organization, consistency, and management issues  take 18-746/15-746 Storage Systems   we’ll talk a bit about file systems next
  • 8. 8 15-213, F’08 What’s Inside A Disk Drive? Spindle Arm Actuator Platters Electronics SCSI connector Image courtesy of Seagate Technology
  • 9. 9 15-213, F’08 Disk Electronics • Connect to disk • Control processor • Cache memory • Control ASIC • Connect to motor Just like a small computer – processor, memory, network iface
  • 10. 10 15-213, F’08 Disk “Geometry” Disks contain platters, each with two surfaces Each surface organized in concentric rings called tracks Each track consists of sectors separated by gaps spindle surface tracks track k sectors gaps
  • 11. 11 15-213, F’08 Disk Geometry (Muliple-Platter View) Aligned tracks form a cylinder surface 0 surface 1 surface 2 surface 3 surface 4 surface 5 cylinder k spindle platter 0 platter 1 platter 2
  • 12. 12 15-213, F’08 Disk Structure Read/Write Head Upper Surface Platter Lower Surface Cylinder Track Sector Arm Actuator
  • 13. 13 15-213, F’08 Disk Operation (Single-Platter View) The disk surface spins at a fixed rotational rate spindle By moving radially, the arm can position the read/write head over any track The read/write head is attached to the end of the arm and flies over the disk surface on a thin cushion of air spindle spindle spindle spindle
  • 14. 14 15-213, F’08 Disk Operation (Multi-Platter View) arm read/write heads move in unison from cylinder to cylinder spindle
  • 15. 15 15-213, F’08 Tracks divided into sectors Disk Structure - top view of single platter Surface organized into tracks
  • 16. 16 15-213, F’08 Disk Access Head in position above a track
  • 17. 17 15-213, F’08 Disk Access Rotation is counter-clockwise
  • 18. 18 15-213, F’08 Disk Access – Read About to read blue sector
  • 19. 19 15-213, F’08 Disk Access – Read After BLUE read After reading blue sector
  • 20. 20 15-213, F’08 Disk Access – Read After BLUE read Red request scheduled next
  • 21. 21 15-213, F’08 Disk Access – Seek After BLUE read Seek for RED Seek to red’s track
  • 22. 22 15-213, F’08 Disk Access – Rotational Latency After BLUE read Seek for RED Rotational latency Wait for red sector to rotate around
  • 23. 23 15-213, F’08 Disk Access – Read After BLUE read Seek for RED Rotational latency After RED read Complete read of red
  • 24. 24 15-213, F’08 Disk Access – Service Time Components After BLUE read Seek for RED Rotational latency After RED read Seek Rotational Latency Data Transfer
  • 25. 25 15-213, F’08 Disk Access Time Average time to access a specific sector approximated by:  Taccess = Tavg seek + Tavg rotation + Tavg transfer Seek time (Tavg seek)  Time to position heads over cylinder containing target sector  Typical Tavg seek = 3-5 ms Rotational latency (Tavg rotation)  Time waiting for first bit of target sector to pass under r/w head  Tavg rotation = 1/2 x 1/RPMs x 60 sec/1 min  e.g., 3ms for 10,000 RPM disk Transfer time (Tavg transfer)  Time to read the bits in the target sector  Tavg transfer = 1/RPM x 1/(avg # sectors/track) x 60 secs/1 min  e.g., 0.006ms for 10,000 RPM disk with 1,000 sectors/track  given 512-byte sectors, ~85 MB/s data transfer rate
  • 26. 26 15-213, F’08 Disk Access Time Example Given:  Rotational rate = 7,200 RPM  Average seek time = 5 ms  Avg # sectors/track = 1000 Derived average time to access random sector:  Tavg rotation = 1/2 x (60 secs/7200 RPM) x 1000 ms/sec = 4 ms  Tavg transfer = 60/7200 RPM x 1/400 secs/track x 1000 ms/sec = 0.008 ms  Taccess = 5 ms + 4 ms + 0.008 ms = 9.008 ms  Time to second sector: 0.008 ms Important points:  Access time dominated by seek time and rotational latency  First bit in a sector is the most expensive, the rest are free  SRAM access time is about 4 ns/doubleword, DRAM about 60 ns  ~100,000 times longer to access a word on disk than in DRAM
  • 27. 27 15-213, F’08 Disk storage as array of blocks OS’s view of storage device (as exposed by SCSI or IDE/ATA protocols)  Common “logical block” size: 512 bytes  Number of blocks: device capacity / block size  Common OS-to-storage requests defined by few fields  R/W, block #, # of blocks, memory source/dest 6 5 7 12 23 … …
  • 28. 28 15-213, F’08 Page Faults A page fault is caused by a reference to a VM word that is not in physical (main) memory  Example: An instruction references a word contained in VP 3, a miss that triggers a page fault exception null null Memory resident page table (DRAM) Physical memory (DRAM) VP 7 VP 4 Virtual memory (disk) Valid 0 1 0 1 0 1 0 1 Physical page number or disk address PTE 0 PTE 7 PP 0 VP 2 VP 1 PP 3 VP 1 VP 2 VP 4 VP 6 VP 7 Virtual address VP 3 From lecture-14.ppt “logical block” number can be remembered in page table to identify disk location for pages not resident in main memory
  • 29. 29 15-213, F’08 In device, “blocks” mapped to physical store Disk Sector (usually same size as block)
  • 30. 30 15-213, F’08 Physical sectors of a single-surface disk
  • 31. 31 15-213, F’08 LBN-to-physical for a single-surface disk 10 9 8 7 6 5 4 3 2 1 0 12 13 11 22 18 16 17 19 20 21 24 15 14 23 28 29 30 31 33 32 34 25 26 27 35 41 42 43 44 46 45 36 37 38 40 39 4 7
  • 32. 32 15-213, F’08 Disk Capacity Capacity: maximum number of bits that can be stored  Vendors express capacity in units of gigabytes (GB), where 1 GB = 109 Bytes (Lawsuit pending! Claims deceptive advertising) Capacity is determined by these technology factors:  Recording density (bits/in): number of bits that can be squeezed into a 1 inch linear segment of a track  Track density (tracks/in): number of tracks that can be squeezed into a 1 inch radial segment  Areal density (bits/in2): product of recording and track density
  • 33. 33 15-213, F’08 Computing Disk Capacity Capacity = (# bytes/sector) x (avg. # sectors/track) x (# tracks/surface) x (# surfaces/platter) x (# platters/disk) Example:  512 bytes/sector  1000 sectors/track (on average)  20,000 tracks/surface  2 surfaces/platter  5 platters/disk Capacity = 512 x 1000 x 80000 x 2 x 5 = 409,600,000,000 = 409.6 GB
  • 34. 34 15-213, F’08 Looking back at the hardware main memory bus interface ALU register file CPU chip
  • 35. 35 15-213, F’08 Connecting I/O devices: the I/O Bus main memory I/O bridge bus interface ALU register file CPU chip system bus memory bus USB controller mousekeyboard graphics adapter monitor disk controller disk I/O bus Expansion slots for other devices such as network adapters
  • 36. 36 15-213, F’08 Reading from disk (1) main memory ALU register file CPU chip disk controller graphics adapter USB controller mousekeyboard monitor disk I/O bus bus interface CPU initiates a disk read by writing a READ command, logical block number, number of blocks, and destination memory address to a port (address) associated with disk controller
  • 37. 37 15-213, F’08 Reading from disk (2) main memory ALU register file CPU chip disk controller graphics adapter USB controller mousekeyboard monitor disk I/O bus bus interface Disk controller reads the sectors and performs a direct memory access (DMA) transfer into main memory
  • 38. 38 15-213, F’08 Reading from disk (3) main memory ALU register file CPU chip disk controller graphics adapter USB controller mousekeyboard monitor disk I/O bus bus interface When the DMA transfer completes, the disk controller notifies the CPU with an interrupt (i.e., asserts a special “interrupt” pin on the CPU)