Download presentation
Presentation is loading. Please wait.
Published bySandra Austin Modified over 9 years ago
1
8.1 Advanced Operating Systems Defeating The Thrashing The RAM is limited. Sometimes, too many processes need large memory allocations and the sum of these allocations is larger than the RAM. Most Operating System schedulers are versions of Round-Robin. Each process will cause a page fault when its turn comes.
2
8.2 Advanced Operating Systems What Can Be Done? When Linux sees too many page faults, Linux will decide on “thrashing” state. On thrashing state Linux will kill memory consuming processes. –Killing a process is a very aggressive action and can cause unwelcome results. Windows ignores the thrashing and the system will continue to mark time.
3
8.3 Advanced Operating Systems Can We Do Better? Two level of scheduling like the old medium scheduler used by some operating systems, can improve the solutions. The first level will schedule groups of processes. The second level will schedule the processes within each group. The memory allocation size of each group will be almost equal to the RAM size.
4
8.4 Advanced Operating Systems The Bin Packing Problem Let P i be a set of processes with memory allocation M i. We need to group the processes such that the sum of M i s in each group will not be bigger than the available RAM. Fewer groups will yield better performance; hence we try to minimize the number of groups. This is exactly the Bin-Packing Problem
5
8.5 Advanced Operating Systems Using Bin-Packing Opps... The Bin-Packing Problem is NP- Hard. Obviously, the exponential algorithm must not be used in the scheduler. –The scheduler must be fast. There are some polynomial approximations solving this problem. Which one is the best? –The answer will be the “First-Fit” approximation, but should be proved.
6
8.6 Advanced Operating Systems “First Fit” “First Fit” algorithm: –Sort the items. –Try to insert each item to an existing bin. –If there is no room for this item, open a new bin. “First Fit” will never take out an item after it has been put in a bin.
7
8.7 Advanced Operating Systems Group Time Slice The group time slice should be long enough in order to prevent thrashing. Sometimes the groups are not equal. –Indeed, a group contains even just one process is possible. Set the time slice duration according to the group size.
8
8.8 Advanced Operating Systems Shared Memory Usually processes with shared memory allocations have the same shared allocation size; hence no need for a special action.
9
8.9 Advanced Operating Systems Interactive Processes Interactive processes need fast response time. Waiting for their group can be an irksome delay. The kernel puts the interactive processes in every group; thus they will always be running. However, in order to be fair, the time slice duration of the interactive processes should be diminished. –The time slice of the interactive processes is divided by the numbers of the bins.
10
8.10 Advanced Operating Systems Real Time Processes Real time processes are similar to interactive processes. They cannot wait for their group to be activated. The solution is similar. The kernel puts real time processes in every group. The only difference is the time slice, which is obviously must not be diminished.
11
8.11 Advanced Operating Systems Priority It might happen that the highest priority processes will be in one group, whereas the lowest priority processes will be in a second group. The time slice is set according to the processes’ average priority within each group.
12
8.12 Advanced Operating Systems No. of Swaps and Execution Time Synthetic Benchmark
13
8.13 Advanced Operating Systems SPEC No. of Swaps and Execution Time
14
8.14 Advanced Operating Systems Time Slice Duration
15
8.15 Advanced Operating Systems Selecting an Approximation
16
8.16 Advanced Operating Systems Conclusions The medium-term scheduler drastically reduces the thrashing overhead. No decline in performance when there is no thrashing. Can easily installed on any Linux machine. The code is free and can be obtained at: http://www.cs.biu.ac.il/~reubenm/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.