Monday, December 10, 2007

Assignment 3

Q:What is the cause of thrashing?

For instance, if your computer has a slow disk drive and you are doing a lot of paging (using virtual memory) to switch from one program to another rapidly, then your disk drive will become a performance bottleneck and your computer will seem to have trouble keeping up with your commands. The computer, here, is "thrashing", spending all of it's time trying to keep up. Imagine a person drowning. They are thrashing because they are spending all of their energy doing one thing to stay alive.

Q:What is the cause of thrashing? How does the system detect thrashing?

Once it detects thrashing, what can the system do to eliminate this problem? - Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming.


Q:Once thrashing is detected,what can the operating system do to eliminate it?

Operating system designers attempt to keep high CPU utilization by maintaining an optimal multiprogramming level (MPL). Although running more processes makes it less likely to leave the CPU idle, too many processes adversely incur serious memory competition, and even introduce thrashing, which eventually lowers CPU utilization. A common practice to address the problem is to lower the MPL with the aid of process swapping out/in operations. This approach is expensive and is only used when the system begins serious thrashing. The objective of our study is to provide highly responsive and cost-effective thrashing protection by adaptively conducting priority page replacement in a timely manner. We have designed a dynamic system Thrashing Protection Facility (TPF) in the system kernel. Once TPF detects system thrashing, one of the active processes will be identified for protection. The identified process will have a short period of privilege in which it does not contribute its least recently used (LRU) pages for removal so that the process can quickly establish its working set, improving the CPU utilization. With the support of TPF, thrashing can be eliminated in its early stage by adaptive page replacement, so that process swapping will be avoided or delayed until it is truly necessary. We have implemented TPF in a current and representative Linux kernel running on an Intel Pentium machine. Compared with the original Linux page replacement, we showthat TPF consistently and significantly reduces page faults and the execution time of each individual job in several groups of interacting SPEC CPU2000 programs. We also show that TPF introduces little additional overhead to program executions, and its implementation in Linux (or Unix) systems is straightforward.

1.Explain the following:

A.Multiprogramming. Why is it used?

A multiprogramming is a technique used to utilize maximum CPU time by running multiple programs simultaneously. The execution begins with the first program and continuous till an instruction waiting for a peripheral is reached, the context of this program is stored, and the second program is memory is given chance to run. The process continued until all program finished running. Multiprogramming has no guarantee that a program will run is timely manner.

B.Internal Fragmentation. How does it occur?

The internal fragmentation occurs it when a fixed partition is partially used by program, the remaining space within the partition is unavailable to any other job and that's the time internal fragmentation occur when there is another job followed on the space. So that it will not wasted.


C.Compaction: Why is it need?

Compaction is very needed because it is the process of collecting fragments of available memory space into contiguous in block by moving programs and data in a
computer's memory disks, or known as garbage collection.

E.Relocation: How often should it performed?

It depend on the process of address refferences in program.

2.Describe the Major Disadvantages for each of the four memory allocation schemes presented in the chapter.

The disadvantage of this memory allocation its an overhead process, so that while compaction is being done everything else must wait.


3.Describe the Major Advantages for each of the memory allocation schemes presented in the chapter.

They could be divided into segments of variable sizes of equal size. Each page, or segment, could be stored wherever there was an empty block best enough to hold it.

No comments: