southgiri.log
로그인
southgiri.log
로그인
Lec 6-Storage Devices (1)
Southgiri
·
2025년 6월 4일
팔로우
0
Operating Systems
Operating Systems
목록 보기
16/18
Hard Disk Drive
Geometry
Hard drives expose a large number of sectors(blocks)
Typically 512 or 4096 bytes(=page size -> easy to swap)
Individual sector writes are
atomic
Multiple sectors writes may be interrupted
Drive geometry
Sectors
arranged into
tracks
Cylinder
is a particular
track on multiple platters
Tracks arranged in concentric circles
on
platters
A disk may have
double-sided platters
LBA: Logical Block Addresses
Types of Delay with Disks
Three types of delay
Rotational delay
Time to
rotate the desired sector
to the read head
Related to RPM
Seek delay
Time to
move the read head to a different track
Transfer time
Time to
read or write
bytes
Track skew
offset sectors so that sequential reads across tracks incorporate seek delay
= Consider movement of read head to a different track
Caculating Transfer time
T
I
/
O
=
T
s
e
e
k
+
T
r
o
t
a
t
i
o
n
+
T
t
r
a
n
s
f
e
r
T_{I/O}=T_{seek} + T_{rotation} + T_{transfer}
T
I
/
O
=
T
s
e
e
k
+
T
r
o
t
a
t
i
o
n
+
T
t
r
a
n
s
f
e
r
Assume transffering 4096 bytes
Cheetah
T
r
o
t
a
t
i
o
n
=
60
s
/
M
15000
R
P
M
×
1000
m
s
/
s
×
1
2
=
2
m
s
T_{rotation} = {{60s/M}\over{15000RPM}}\times 1000ms/s\times {{1}\over{2}}=2ms
T
r
o
t
a
t
i
o
n
=
1
5
0
0
0
R
P
M
6
0
s
/
M
×
1
0
0
0
m
s
/
s
×
2
1
=
2
m
s
T
t
r
a
n
s
f
e
r
=
4096
B
125
M
B
/
s
×
1000
m
s
/
s
≈
0.03
m
s
T_{transfer}={{4096B}\over{125MB/s}}\times 1000ms/s \approx0.03ms
T
t
r
a
n
s
f
e
r
=
1
2
5
M
B
/
s
4
0
9
6
B
×
1
0
0
0
m
s
/
s
≈
0
.
0
3
m
s
4
m
s
+
2
m
s
+
0.03
m
s
≈
6
m
s
4ms+2ms+0.03ms \approx 6ms
4
m
s
+
2
m
s
+
0
.
0
3
m
s
≈
6
m
s
Barracuda
T
r
o
t
a
t
i
o
n
=
60
s
/
M
7200
R
P
M
×
1000
m
s
/
s
×
1
2
≈
4.17
m
s
T_{rotation} = {{60s/M}\over{7200RPM}}\times 1000ms/s\times {{1}\over{2}}\approx4.17ms
T
r
o
t
a
t
i
o
n
=
7
2
0
0
R
P
M
6
0
s
/
M
×
1
0
0
0
m
s
/
s
×
2
1
≈
4
.
1
7
m
s
T
t
r
a
n
s
f
e
r
=
4096
B
105
M
B
/
s
×
1000
m
s
/
s
≈
0.03
m
s
T_{transfer}={{4096B}\over{105MB/s}}\times 1000ms/s \approx0.03ms
T
t
r
a
n
s
f
e
r
=
1
0
5
M
B
/
s
4
0
9
6
B
×
1
0
0
0
m
s
/
s
≈
0
.
0
3
m
s
9
m
s
+
4.17
m
s
+
0.03
m
s
≈
13.2
m
s
9ms+4.17ms+0.03ms \approx 13.2ms
9
m
s
+
4
.
1
7
m
s
+
0
.
0
3
m
s
≈
1
3
.
2
m
s
Sequential vs Random Access
Sequential Access
Caculate rotational and seek time only once
Caching
Many disks incorporate caches
Read caching
Reduces read delays
Write caching
Write back cache
Write on only cache
Possibly dangerous (Volatile -> power off -> cache doesn't exist)
Write through cache
Write on disk too
Some disks include flash memory for persistent caching
Disk Scheduling
Caching can't make up for poor random access time
A queue of requests to the disk, they can be reordered to improve performance
FCFS: First come, first serve
SSTF: Shortest seek time first
Minimize seek time by
always selecting the block with the shortest seek time
Optimal
Prone to starvation
SCAN (Elevator)
Sweeps across the disk servicing requests in order
No starvation
Average access times are less for requests at
high and low addresses
C-SCAN
Service requests in one direction
Fairer than SCAN
Worse performance than SCAN
C-LOOK
Only goes as far as the last request (not until the end)
Implementing Disk Scheduling
Where should be implemented?
OS Scheduling
OS cannot account for rotation delay
Do not know where the head is (mechanically)
On-disk Scheduling
Disk knows the exact position of the head and platters
But requires specialized hardware and drivers
Command Queuing
Feature where a
disk stores of queue of pending read / write requests
Called NCQ(Native Command Queuing) in SATA
Disk may
reorder items in the queue
Tagged command queuing
Allow the host to place constraints on command re-ordering
Southgiri
팔로우
이전 포스트
Lec 5-Concurrency (3)
다음 포스트
Lec 6-Storage Devices (2)
0개의 댓글
댓글 작성