1 / 74

4330/6310 FIRST ASSIGNMENT Summer 2014

4330/6310 FIRST ASSIGNMENT Summer 2014. Jehan-François Pâris jfparis@uh.edu. C. C. S Q. R Q. IN. SSD. The model. We have One dual-core CPU One SSD One input device Two queues CPU queue "ready queue" SSD queue. FIRST EXAMPLE. Start: Process 0 at t = 5 ms. C. C. S Q. R Q.

moswen
Télécharger la présentation

4330/6310 FIRST ASSIGNMENT Summer 2014

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 4330/6310 FIRST ASSIGNMENTSummer 2014 Jehan-François Pârisjfparis@uh.edu

  2. C C S Q RQ IN SSD The model We have • One dual-core CPU • One SSD • One input device • Two queues • CPU queue "ready queue" • SSD queue

  3. FIRST EXAMPLE

  4. Start: Process 0 at t = 5 ms C C S Q RQ IN SSD NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  5. Your program will display • Process 0 startsTime = 5 ms or • Process 0 starts at t = 5 ms

  6. Process 0 grabs a core at t = 5 ms C C S Q RQ IN SSD First core busy until t = 105 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  7. What happens next? C C S Q RQ IN SSD First core busy until t = 105 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  8. Process 1 starts at t = 100 ms C C S Q RQ IN SSD First core busy until t = 105 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  9. Your program will display • Process 1 startsTime = 100 msProcess 0 is WAITING or • Process 1 starts at t = 100 msProcess 0 is WAITING

  10. Process 1 grabs a core at t = 100 C C S Q RQ IN SSD First core busy until t = 105 msSecond core busy until t = 120 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  11. What will happen next? C C S Q RQ IN SSD First core busy until t = 105 msSecond core busy until t = 120 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  12. Process 0 gets input at t = 105ms C C S Q RQ IN SSD Second core busy until t = 120 ms Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  13. What happens next? C C S Q RQ IN SSD Second core busy until t = 120 ms Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  14. Process 1 visits SSD at t = 120 ms C C S Q RQ IN SSD First core busy until t = 140 ms Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  15. Process 1 grabs a core at t = 120 ms C C S Q RQ IN SSD First core busy until t = 140 ms Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  16. What happens next? C C S Q RQ IN SSD First core busy until t = 140 ms Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  17. Process 1 terminates at t = 140ms C C S Q RQ IN SSD Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  18. Your program will display • Time = 140 msProcess 1 terminatesProcess 0 is WAITING or • Process 1 terminates at t = 140 msProcess 0 is WAITING

  19. C C S Q RQ IN SSD The three process states • RUNNING meansexecuting on acore • READY means waiting for a core • WAITING meansbeing neitherRUNNING orREADY

  20. What happens next? C C S Q RQ IN SSD Process 0 busy until t = 5105 ms NEW 5 CPU 100 INPUT 5000CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  21. Process 0 grabs a core at t = 5105 ms C C S Q RQ IN SSD First core busy until t = 5185 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  22. What happens next? C C S Q RQ IN SSD First core busy until t = 5185 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  23. Process 0 visits SSD at t = 5185ms C C S Q RQ IN SSD SSD busy until t = 5186 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  24. What will happen next? C C S Q RQ IN SSD SSD busy until t = 5186 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  25. Process 0 grabs a core at t = 5186 ms C C S Q RQ IN SSD First core busy until t = 5216 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  26. What happens next? C C S Q RQ IN SSD First core busy until t = 5216 ms NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  27. Process 0 terminates at t = 5216 ms C C S Q RQ IN SSD NEW 5 CPU 100 INPUT 5000 CPU 80 SSD 1CPU 30 NEW 100CPU 20 SSD 0 CPU 20

  28. Your program will display (I) • Process 0 terminatesTime = 5216 ms or • Process 0 terminates at t = 5216 ms

  29. Your program will display (II) • SUMMARY:Number of processes that completed: 2Total number of SSD accesses: 2Average SSD access time: 0.5 msTotal elapsed time: 5216 msCPU utilization: 4.79 percentSSD utilization: 0.02 percent

  30. How to compute CPU utilization • Keep track of total time for all RUN requests: • 100 + 80 + 30 + 20 + 20 = 250 ms • Divide by elapsed time: • 250/5216 = 0.0479 (rounded) • Since there are two cores, the maximum CPU utilization is 2.0

  31. How to compute SSD utilization • Keep track of total time for all SS requests: • 0 + 1 = 1 ms • Divide by elapsed time: • 1/5216 = 0.0002 (rounded) • SSD utilization is normally computed for each storage device, so it will never exceed 1.0

  32. INTRODUCING CONTENTION

  33. P 0 grabs a core at t = 5 ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms

  34. What's next? C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms

  35. P 1 grabs a core at t = 20 ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 70ms

  36. What's next? C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 70ms

  37. P 2 waits for a core at t = 30 ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 70ms

  38. What's next? C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 70ms

  39. P 1 visits SSD then waits at t = 70ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms

  40. P 2 grabs core at t = 70ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 90ms

  41. What's next? C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 90 ms

  42. P 2 visits SSD then waits at t = 90ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 120 ms

  43. P 1 grabs a core at t = 90 ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 140 ms

  44. What's next? C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 105 ms Second core busy until t = 140 ms

  45. P 0 visits SSD then waits at t=105 ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 Second core busy until t = 140 ms

  46. P grabs a core at t=105 ms C C S Q RQ IN SSD NEW 5 CPU 100 SSD 0 CPU 30 NEW 20CPU 50 SSD 0 CPU 50NEW 30CPU 20 SSD 0 CPU 20 First core busy until t = 125 ms Second core busy until t = 140 ms

  47. To be continued • …

  48. SSD average access time • Not as simple to compute as before when there is SSD contention • Must compute difference between • SSD request time • SSD request completion time for each SSD request

  49. The best way to implement it • Have two counters both initialized at zero • SSDcount • SSDtimes • When a SSD request is issued by a process • Add 1 to SSDcount • Subtract current time from SSDtimes • When a SSD request is issued by a process • Add current time to SSDtimes

  50. ENGINEERING THE SIMULATION

More Related