Modeling multiprogramming Operam tting Systems 20%/0 wait 100 980 50%I/o wait 60 80%I/o wait 012345678910 Degree of multiprogramming CPU utilization as a function of number of processes in memory Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 8 Modeling Multiprogramming CPU utilization as a function of number of processes in memory Degree of multiprogramming
Modeling multiprogramming tting Systems c Suppose a computer has 32MB of memory, with the os taking up 16MB and each user program taking up 4MB H These sizes allow 4 programs to be in memory at once. With an 80% average lO wait. we have a cPu utilization of 1-0.8460% H Adding another 1 6MB of memory allow 8 programs, thus raising the CPU utilization to 83% w Adding yet another 1 6MB of memory allow 12 programs, only increase CPU utilization to 93% ..97 Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 9 Modeling Multiprogramming Suppose a computer has 32MB of memory, with the OS taking up 16MB and each user program taking up 4MB. These sizes allow 4 programs to be in memory at once. With an 80% average I/O wait, we have a CPU utilization of 1-0.8^4≈60%. Adding another 16MB of memory allow 8 programs, thus raising the CPU utilization to 83%. Adding yet another 16MB of memory allow 12 programs, only increase CPU utilization to 93%. …97% …
Operating Systems G> Analysis of Multiprogramming System Performance CPU Arrival minutes Processes Job time needed 1234 1000 CPU idle 10:10 4322 CPU busy 20364959 10:15 CPU/process. 20. 18. 16.1 1020 2.0 3Ir Job 1 finishe 9 8 31 9 2 Job 2 starts 8 3 9 3 15 2022 27.628231.7 Time(relative to job 1's arrival) (a) Arrival and work requirements of 4 jobs g(b)CPU utilization for 1-4 jobs with 80%I0 wait e()Sequence of events as jobs arrive and finish i note numbers show amount of CPU time jobs get in each interval Gao Haichang, Software School, Xidian University 10
Operating Systems Gao Haichang , Software School, Xidian University 10 Analysis of Multiprogramming System Performance (a) Arrival and work requirements of 4 jobs (b) CPU utilization for 1 – 4 jobs with 80% I/O wait (c) Sequence of events as jobs arrive and finish note numbers show amount of CPU time jobs get in each interval
Operating Systems Relocation and protection g Cannot be sure where program will be loaded in memory t address locations of variables code routines cannot be absolute w must keep a program out of other processes' partitions g Use base and limit values i address locations added to base value to map to physical addr address locations larger than limit value is an error Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 11 Relocation and Protection Cannot be sure where program will be loaded in memory address locations of variables, code routines cannot be absolute must keep a program out of other processes’ partitions Use base and limit values address locations added to base value to map to physical addr address locations larger than limit value is an error
Operating Systems Base and Limit register limit relocation register register logical physical address yes address CPU memory no trap; addressing error Gao Haichang, Software School, Xidian University 12
Operating Systems Gao Haichang , Software School, Xidian University 12 Base and Limit register