3.4k views

Consider a disk with the following specifications: 20 surfaces, 1000 tracks/surface, 16 sectors/track, data density 1 KB/sector, rotation speed 3000 rpm. The operating system initiates the transfer between the disk and the memory sector-wise. Once the head has been placed on the right track, the disk reads a sector in a single scan. It reads bits from the sector while the head is passing over the sector. The read bits are formed into bytes in a serial-in-parallel-out buffer and each byte is then transferred to memory. The disk writing is exactly a complementary process.

For parts (C) and (D) below, assume memory read-write time = 0.1 microseconds/byte, interrupt driven transfer has an interrupt overhead = 0.4 microseconds, the DMA initialization, and termination overhead is negligible compared to the total sector transfer time. DMA requests are always granted.

1. What is the total capacity of the desk?
2. What is the data transfer rate?
3. What is the percentage of time the CPU is required for this disk I/O for byte-wise interrupts driven transfer?
4. What is the maximum percentage of time the CPU is held up for this disk I/O for cycle-stealing DMA transfer?

edited | 3.4k views
+1

bite-wise interrupts driven transfer?

I think it should be -->  *byte-wise interrupts driven transfer

+1

@Shaik Masthan can you please explain D part?

1. Device will tell if it wants to read/write

4. Based on address in address reg and word count, Direct I/O will be done from Mem to device.

5. Based on this how holding of CPU is calculated here?

+1

For parts (C) and (D) below, assume memory read-write time = 0.1 microseconds/byte  -> This part of question says the memory cycle time is 0.1microseconds per byte, this is the time where CPU is blocked

so % CPU time blocked= $\frac{ memory cycle time}{Data transfer time per byte}$

Correct me if I'm wrong

0

$(a)$ $20 \times 1000 \times 16 \times 1 KB = 3,20,000 KB$

$(b)$
\begin{align*} 3000 \text{ rotations} &= 60 \text{ seconds}\\ 1 \text{ rotation} &= \frac{60}{3000} \text{ seconds}\\ 1 \text{ rotation} = 1 \text{ track} &= \frac{1}{50} \text{ seconds}\\ 1 \text{ track} = 16\times 1 KB &= \frac{1}{50} \text{ seconds}\\ 800 KB &= 1 \text{ second}\\ \end{align*}

Hence, transfer rate $= 800 KB/s$

$(c)$ Data is transferred byte-wise; given in the question.
CPU read/write time for a byte $= 0.1 \mu s$
Interrupt overhead (counted in CPU utilization time only) $= 0.4 \mu s$
Transfer time for 1 byte data which took place at the rate of $800\; KB/s = 1.25 \mu s$
Percentage of CPU time required for this job $=\dfrac{0.1+0.4}{0.4 + 0.1 + 1.25} \times 100 = 28.57\%$

$(d)$ Percentage of CPU time held up for disk I/O for cycle stealing DMA transfer $= \dfrac{0.1+0}{1.25} \times 100 = 8.00 \%$
by Boss (30.7k points)
edited
0
Percentage of CPU time required for this job = 0.1+0.40.5+1.25×100=28.57% for part c.

But the time interval between two interrupts is 1.25 microseconds. So in denominator it should be only 1.25microsecond. can someone clear??
+9
memory read write time= bus transfer time from Disk to memory + memory latency right?

In interrupt driven IO this time is devoted by CPU(means CPU does not perform any internal work too it remains busy with this IO till it completes) ,bcz CPU controls the IO transfer but in DMA this time CPU is held up(CPU may operform some internal work but not bus related activity ) bcz DMA controls the transfer
0
So in DMA the time CPU is held up, in this we will count the time of DMA transfer even though CPU is free to perform other tasks??
+2
D should be $\frac{0.1}{1.25}*100$
+3
Why dont we consider rotational latency along with disk transfer time?
+2
@Arjun Sir,@Bikram Sir for cycle stealing DMA it should be 0.1/1.25 only
0
There are 20 surfaces .so total data transfer rate =20* 800

Because there could be one r/w head at each surface parallaly .
+1

@Anup

Because there could be one r/w head at each surface parallaly .

There is no such info in question regarding it have 1 Read/Write Heads per surface or 1 Read/Write Heads for all surface ..

if it is 1 Read/Write Heads per surface then we need to multiply and if it is 1 Read/Write Head for all surface  we don't multiply.. Now tell me what is default case ? in question this information is missing..

here https://gateoverflow.in/2650/gate1995_14 also no such info and we did not multiplied with #of surface .. but for data transfer rate, we consider a single surface only ..

0
When we consider data transfer rate, we consider a single surface only .. hence no need to multiply with # of surface.
+4
in part D why isn't denominator 1.25 +0.1? @ Bikram Sir?
+2
In some answers I saw that even in interrupt driven parallelism takes place and percentage of CPu blocked is x/y which is 0.5/1.25 but here we have added 0.5 again in denominator too.

Confused !!!!
0
same doubt..In interrupt driven when data is transfering next byte is also being ready..both are working parallely

<---0.5--->       <---0.5--->       <---0.5--->    //data transfer

<-----1.25----><----1.25------><----1.25-------><----1.25----->  //data preparaation time

CPU time= $\frac{0.5}{1.25}$

@Arjun sir plz clear this doubt
0

Hi @reena_kandari ji,

same doubt..In interrupt driven when data is transfering next byte is also being ready..both are working parallely

I think here it is possible because only one buffer of size 8- first half register read and in second half register write.

0
@chhotu as it is given in question cycle stealing mode so in part d) it should be 0.1/1.25.

Why do you think denominator is 1.25+.1?
+1

Hi @gari ji, You are correct. I was thinking something else.

@sushmita ji, in part d) it should be 0.1/1.25 only.

0

@Chhotu can you please explain why the total time is not equal to (0.1+1.25) in part d (DMA mode)?

0

@Chhotu pls explain why in denominator is should not be (0.1+1.25) i didn't get it

+2

@dharmesh7

Read this: https://gateoverflow.in/140573/%25-time-of-cpu-blocked-in-dma. You will get the concept.

a) 20*1000*16*1=32000 KB

b) in 60 sec 3000 rounds

in 1 sec 50 rounds

therefore 50 tracks can be read in 1 sec

therefore 50*16*1 KB of data read in 1 sec

data rate =800 KB/sec

c) 800 KB of data is read in 1 sec

1 Byte of data can be read in 1/(800*1024) secs= 1.22 micro Sec

total time = .5 + 1.22 = 1.72 micro sec

% of cpu time required =(.5/1.72)*100 =29%

d)  Since there is no overhead(assumed in question) for DMA transfer. Therefore :

Byte transfer takes 1.22 microsecond (same logic as in part (c)).

writing this to memory takes 0.1 microsecond

%age of CPU involvement= (0.1)/(0.1+1.22)= 7.5%

by Active (4k points)
edited by
+2
For (D) part:

Since there is no overhead(assumed in question) for DMA transer. Therefore :

Byte transfer takes 1.22 microsecond (same logic as in part (c)).

writing this to memory takes 0.1 microsecond

%age of CPU involvement= (0.1)/(0.1+1.22)= 7.5%
0
Thanks !!!
0

in [c]

% of cpu time required =(.4/1.72)*100 =23.25%

only interruppt processing will utilize cpu.

0
Hi Danish ,

Could you please give me a link with an elaborate explanation for such kind of problems . ?
I'm able to understand a bit , but get stuck at some places ..
0
can you provide some article or where i can find similar type questions, cpu read write time 0.1 micro second/byte , i am having difficulty in understanding why you are using that way in the formula.,i mean why are you adding it(the rate)?
+11

What I am able to get here is-

For C part :-  One byte data is to be transferred to CPU first by interrupting the CPU and interrupt over head is given as 0.4 microsec. As CPU will do some processing on this data then it will transfer this one byte to main memory it will take 0.1 microsec.  So total CPU overhead is 0.5 microsec.

Now total time taken is given as = (Time taken by disk controller to transfer a byte) + (CPU overhead)

=1.25 microsec + 0.5 microsec= 1.75 microsec.

% of CPU time used in total time= CPU time/ Total time = 0.5/1.75 = 28.5%

For D part :- As it is given only DMA transfer is done , no interrupt instruction is to be executed on CPU, it just need to transfer byte from disk to main memory via bus, this overhead will cost CPU 0.1 microsec.(mem read/write time)

Total time taken in DMA transfer without interrupt =  (Time taken by disk controller to transfer a byte) + (CPU overhead for mem read/write)

=1.25 microsec + 0.1 microsec= 1.35 microsec.

% of CPU time used in total time= CPU time/ Total time = 0.1/1.35 = 7.4%

0
@ravi kaushik

Could you provide any resource for clearing disk management concepts for gate 2019 ....

A) 20× 1000 × 16 × 1KB=3,20,000 × 1KB=3,20,000KB

B)

Step1:- find the rotational latency:-

Rotational speed=3000 rpm

3000 rpm=60 sec

1 rpm= 60/3000 sec= rotational delay=20 msec

Rotational latency (Ravg) = 1/2 x 1 rpm= 1/2  x 20 =10 msec

Step2:- To find transfer rate

Transfer rate = bytes on track/rotational delay= (16 x 1 KB)/20 ms=800 KB/sec

C) Data is transferred Byte wise; given in the question.

CPU read/write time for a Byte = 0.1 μs

Interrupt overhead (counted in CPU utilization time only) = 0.4 μs

Transfer time for 1 Byte data which took place at the rate of 800 KB/sec = 1/800KB=1.25 μs

Percentage of CPU time required for this job =

Total time = 0.5 + 1.22 = 1.72 μs

Percentage of CPU time required for this job = 0.5/1.72 x 100 =29%

D) Percentage of CPU time held up for disk I/O for cycle stealing DMA transfer =0.1/1.25  x100 =8 %

by Active (2.4k points)
edited