Upload
others
View
19
Download
0
Embed Size (px)
Citation preview
Department of Computer Science
DCS
COMSATS Institute of Information Technology
Secondary Storage Management
Rab Nawaz JadoonAssistant Professor
COMSATS University, Lahore
Pakistan
Operating System Concepts
Department of Computer Science
Secondary storage
Secondary storage (also known as external memory or auxiliary storage), differs from primary storage in that it is not directly accessible by the CPU.
The computer usually uses its input/output channels to access secondary storage and transfers the desired data using intermediate area in primary storage.
Secondary storage does not lose the data when the device is powered down—it is non-volatile
2
Department of Computer Science
In modern computers, hard disk drives are usually used as secondary storage.
The time taken to access a given byte of information stored on a hard disk is typically a few thousandths of a second, or milliseconds.
By contrast, the time taken to access a given byte of information stored in random-access memory is measured in billionths of a second, or nanoseconds.
3
Department of Computer Science
The secondary storage is often formatted according to a file system format, which provides the abstraction necessary to organize data into files and directories.
Most computer operating systems use the concept of virtual memory, allowing utilization of more primary storage capacity than is physically available in the system.
As the primary memory fills up, the system moves the least-used chunks (pages) to secondary storage devices (to a swap file or page file), retrieving them later when they are needed. As more of these retrievals from slower secondary storage are necessary, the more the overall system performance is degraded.
4
Department of Computer Science
Internal structure of HDD
5
Department of Computer Science
Internal structure of HDD
6
Department of Computer Science
Disk Scheduling
Seek time
The seek time of a hard disk measures the amount of time required for the read/write heads to move between tracks over the surfaces of the platters.
Seek time is one of the most commonly discussed metrics for hard disks, and it is one of the most important positioning performance specifications.
Throughput
Number of requests serviced in a unit time.
7
Department of Computer Science
Response time
Waiting time plus service time
Variance of response time
It is the deviation of an item from average of other item.
Transmission time
Time taken in reading / writing for a particular request for its execution.
8
Department of Computer Science
Scheduling objectives
There are two objectives for any disk scheduling algorithm:
Maximize the throughput - the average number of requests satisfied per time unit.
Minimize the response time - the average time that a request must wait before it is satisfied.
9
Department of Computer Science
Scheduling Algorithms
FCFS
First Come First Serve
SSTF
Shortest Seek Time First
SCAN Scheduling
N-SCAN
C-SCAN
10
Department of Computer Science
FCFS
Perform operations in order requested
No reordering of work queue.
It is acceptable when the load on the disk is light.
No starvation: every request is serviced.
Response time large.
Poor performance.
11
Department of Computer Science
SSTF
In SSTF scheduling the request that results in the shortest seek distance is serviced next
It is a cylinder oriented scheme
In this scheme the inner most and outer most track can receive poor service compared with mid range tracks.
Throughput increases
Response time decreases
Variance of response time increased
12
Department of Computer Science
SSTF
13
Department of Computer Science
SCAN Scheduling
Inward and outward sweep is involved in this scheduling.
During inward sweep, any request come then it process it within a sequence and then reaching at the last track and then it will come back and SCAN all the remaining requests.
Advantage
Throughput and response time more
Variance of response time lesser as compare to SSTF
Disadvantage
No priority of any request
14
Department of Computer Science
SCAN
15
Department of Computer Science
SCAN
16
Department of Computer Science
N-SCAN
In this strategy the disk arm moves back and forth as in scan except that it service only those requests waiting when a particular sweep begins.
Requests arriving during a sweep are group together and service them during the return sweep.
On each sweep, the first N requests are serviced.
It avoids the possibility of indefinite postponement.
Throughput Greater
Response time and variance of response time
lesser
Disadvantage no priority is given to requests
17
Department of Computer Science
SCAN Scheduling
18
Department of Computer Science
C-SCAN Another interesting modification in the basic
SCAN strategy is called C-SCAN.
It eliminates the weaknesses of the earliest strategies against the innermost and outermost tracks or cylinders.
In this scheme the arm moves from the outer cylinder to inner cylinder, servicing requests on a shorter seek basis. when the arm has completed its inner sweep, it jumps to the request nearest the outermost cylinder and then resume its inward sweep processing requests.
Request arriving on the current sweep are serviced on the next sweep.
Small variance in response time.
19
Department of Computer Science 20