retagged by
15,001 views
22 22 votes
What is formula for % of time CPU gets blocked??

Is it  X(X+Y) or X/Y only???

What is formula for % of time CPU is consumed in Interuppt driven IO??? Formula for % of CPU slow down in interrupt driven IO???

2 Answers

Best answer
31 31 votes

For cycle stealing mode.

Lets say that you are asked to find out the percentage for which CPU is blocked.

REF: 
https://gateoverflow.in/113433/madeeasy#a113746
https://gateoverflow.in/1393/gate2005-70
https://gateoverflow.in/17666/how-much-time-will-the-processor-slowed-down-due-dma-activity
https://gateoverflow.in/113433/madeeasy

Lets assume that device transfer rate(i.e the rate at which the device buffer is filled up)is  x bytes/sec


If processor can transfer y bytes(i.e bus length) in 1 cycle(assume 1 cycle of 1 sec ) then bus speed is y bytes/sec.


Now, assume any time slot or time quantum say 1 sec.

Now, in this 1 sec, x bytes will be accumulated in device buffer. If x bytes arent vacated in that 1sec, device buffer will spill.

So, I transfer x bytes acumulated in that 1 sec in device buffer at bus speed. Time taken for this is x/y sec.

Now, out of 1 sec for processor, I consumed x/y sec for device data transfer.


So, processor is slowed by x/y sec for every 1 sec.

Hence, slowdown = (x/y) / (assumed time slot) = (x/y) / 1

Add the interrupt processing time to (x/y) if given.


For burst mode. ( By default mode) Default is Burst Mode we assume ..

Consider the disk drive with the following specification:- 

16 surfaces, 1024 tracks/surface, 1024 sectors/track, 1KB/sector, rotation speed is 3000 rpm and the disk is operated in burst Mode. The processor runs at 600 MHZ and takes 300 & 900 clock cycle to initiate & complete DMA transfer respectively, if the size of transferred data is 20KB. 

 The percentage of processor time consumed for the transfer operation is__________


Time consumed is only when initiation and completion of DMA takes place i.e 300+ 900 cycles.


Initial time = 300 * (1/ 600 * 10^6 ) = 0.5 microsec 
terminate time = 900 * (1/ 600 * 10^6) = 1.5 microsec 
time for 1 revolution = 60/3000 sec 
so in 1 revoluution data transfer is 1024 KB 
in 1 sec data transfer is  (1024 * 3000 )/ 60 KB = 50 MB ,  now rate is 50 MB/sec 
Data transfer time for 20kB = (20 KB/ 50MB) sec =  400 microsec 

% CPU consumed = [ ( Initial time + termination time)/ total time ] * 100 =  0.49%

Here, total time = initiation + transfer + completion

Note:

1) In cycle stealing mode,  CPU is interrupted only when the data is ready in buffer. So, transfer of data to MM takes place at speed of bus.

2) In burst mode, data transfer to MM takes place at device transfer rate. 


For interrupt Mode:

CPU time consumed = processing the interrupt + transfer the data in device buffer at bus speed

TOtal time consumed = interval between the interrupts

% consumed = (CPU time consumed) / (total time consumed) * 100

edited by
7 7 votes

Regarding DMA burst mode ,where data to be transferred is k bytes, speed of i/o device is x and speed of bus is y.

1.) I/O device prepares k bytes of data in its buffer for k/x secs meanwhile CPU is operational.Then it request CPU for bus access where some time is spent in initialisaation and then takes k/y secs to transfer the data to memory.

If the speed of the bus is  mentioned . We use this approach.

2.) DMA controller requests for bus access, CPU takes some time for initilazing DMA then device transfers k bytes directly to the memory in k/x sec

 If the speed of the bus is not mentioned . We use this approach.

Position:
Show:

Related questions

2 2 votes
1 1 answer
1.4k
1.4k views
ajayraho asked Nov 21, 2023
1,370 views
A hard disk with a transfer rate of 1 Mbytes/ second is constantly transferring data to memory using DMA. The processor runs at 500 MHz, and takes 500 and 1000 clock cycl...
3 3 votes
1 1 answer
1.0k
1.0k views
Miracle124 asked Oct 18, 2024
1,001 views
DMA
Consider 4 MBPS IO devices connected to 64 bit CPU using DMA interface. 64 words data is transfer from the IO to memory using DMA interface. Main memory machine cycle tim...
1 1 vote
2 2 answers
1.8k
1.8k views
Gurdeep Saini asked Jan 4, 2019
1,782 views
True/false1. To access bus the DMA does not issue an interrupt it is done through DMA-request and DMA-acknowledge wires. Interrupt is issued by DMA to CPU only after comp...
3 3 votes
2 answers 2 answers
1.4k
1.4k views
Souvik33 asked Dec 2, 2022
1,402 views
MSQA ‘Running’ process is surely put into ‘Blocked/Wait’ state during while requesting for an I/O, in which of the following I/O modes?Synchronous I/OAsynchronous I/OInte...