The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+20 votes
1.7k views

Consider a disk with following specifications: 20 surface, 1000 tracks/surface, 16 sectors/track, data destiny 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 microsecond/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 bite-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?
asked in CO & Architecture by Veteran (68.8k points)
recategorized ago by | 1.7k views

bite-wise interrupts driven transfer?

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

3 Answers

+18 votes
Best answer
Q.a) $20 \times 1000 \times 16 \times 1KB = 3,20,000KB$

Q.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 1KB &= \frac{1}{50} \text{ seconds}\\ 800KB &= 1 \text{ second}\\ \end{align*}$

Hence, transfer rate = 800 KB/sec

Q.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/sec = 1.25 $\mu s$
Percentage of CPU time required for this job = $\frac{0.1+0.4}{0.5 + 1.25} \times 100 = 28.57\%$

Q.d)
Percentage of CPU time held up for disk I/O for cycle stealing DMA transfer = $\frac{0.1+0}{1.25} \times 100 = 8.00 \%$
answered by Veteran (30.5k points)
edited by
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??
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
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??
D should be $\frac{0.1}{1.25}*100$
Why dont we consider rotational latency along with disk transfer time?
@Arjun Sir,@Bikram Sir for cycle stealing DMA it should be 0.1/1.25 only
There are 20 surfaces .so total data transfer rate =20* 800

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

@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 ..

Default case is 1 Read/Write Heads per surface, see below picture

but for data transfer rate, we consider a single surface only ..

When we consider data transfer rate, we consider a single surface only .. hence no need to multiply with # of surface.
in part D why isn't denominator 1.25 +0.1? @ Bikram Sir?
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 !!!!
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

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.

Refer -> https://gateoverflow.in/116524/coa-dma-doubt#c131553

@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?

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

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

+6 votes

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

overhead =.1+.4=.5 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%

 

 

answered by Loyal (3.8k points)
edited by
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%
Thanks !!!

in [c]

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

only interruppt processing will utilize cpu.

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 ..
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)?

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 votes

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 overhead =0.1+0.4=0.5 μs

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 %

answered by Loyal (3.2k points)
edited by
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,442 questions
39,188 answers
108,798 comments
36,561 users