recategorized by
64,992 views
63 votes
63 votes

Consider a disk drive with the following specifications:

$16$ surfaces, $512$ tracks/surface, $512$ sectors/track, $1$ KB/sector, rotation speed $3000$ rpm. The disk is operated in cycle stealing mode whereby whenever one $4$ byte word is ready it is sent to memory; similarly, for writing, the disk interface reads a $4$ byte word from the memory in each DMA cycle. Memory cycle time is $40$ nsec. The maximum percentage of time that the CPU gets blocked during DMA operation is:

  1. $10$
  2. $25$
  3. $40$
  4. $50$
recategorized by

12 Answers

1 votes
1 votes

Please see the solution given by an IIT professor for the same problem with a little change in parameters in the following

0 votes
0 votes
I did this question by simply calculating transfer rate per byte

3000 rpm means 20ms that means Entire track capacity we can transfer in 20ms

Now Track capacity is $2^{19}B$

1 B transfer time comes out to be 38.147ns

But as our DMA is capable to send 4B in one go,

Time saved is 4 times of this,

Time taken in 4B will be 38.147/4ns which is 9.5367ns

 

Use cycle stealing formula now

$(1 -\frac{9.5367}{40} )\times 100$

comes out to be 23.84%

 

Nearest was 25 was 25% is the answer
–1 votes
–1 votes

Rotational Latency

In 1 min. we have 3000 revolutions. Therefore, for one rotation we need

$Rotational Latency = 60/3000 = 20ms$

Sector Read/Write Time

In 20ms we can read 512 sectors. Therefore, for reading/writing one sector is

$Time \ to \ read/write \ a \ sector = 20 \ ms / 512 = 39.06 \mu s$

To transfer 1KB of data from the disk to the memory

The transfer happens byte-wise as mentioned in the question for disk to memory.

The time to transfer 1KB of data using DMA with 40ns cycle time is

$DMA \ Transfer \ Time = 40ns * 1024 = 40.96 \mu s$

The % time where the CPU will be blocked is

$ \% CPU\ Block= DMA\ Transfer\ Time\ / Total\ Transfer\ Time$

$\% CPU\ Block = \frac{DMA\ Transfer\ Time}{DMA\ Transfer\ Time\ + Sector\ Read\ Time}$

$ \% CPU\ Block = 40.96 \mu s / (40.96 \mu s + 39.96 \mu s ) \\ \% CPU\ Block = 51.18 = (approx) 50 %$

If we consider transfer from memory to disk, since DMA transfers 4 byes in each DMA cycle, the CPU wait time is much less (about 10%)

Therefore, the answer is (D) 50%

reshown by
Answer:

Related questions

23 votes
23 votes
5 answers
1
Kathleen asked Sep 22, 2014
19,846 views
What is the swap space in the disk used for?Saving temporary html pagesSaving process dataStoring the super-blockStoring device drivers
1 votes
1 votes
1 answer
3
0 votes
0 votes
0 answers
4
Shadan Karim asked Jan 7, 2019
211 views