Thrash (computer science)

Thrash (computer science)

In computer science, thrash (verb), is the term used to describe a degenerate situation on a computer where increasing resources are used to do a decreasing amount of work. In this situation the system is said to be "thrashing". Usually it refers to two or more processes accessing a shared resource repeatedly such that serious system performance degradation occurs because the system is spending a disproportionate amount of time just "accessing" the shared resource. Resource access time may generally be considered as wasted, since it does not contribute to the advancement of any process.

Silly window syndrome is a type of communications system thrashing.

Overview

In modern computers, thrashing may occur in the paging system (if there is not 'sufficient' physical memory or the disk access time is overly long), or in the communications system (especially in conflicts over internal bus access), etc. Depending on the configuration and algorithms involved, the "throughput" and "latency" of a system may degrade by multiple orders of magnitude.

In virtual memory systems, thrashing may be caused by programs or workloads that present insufficient locality of reference: if the working set of a program or a workload cannot be effectively held within physical memory, then constant data swapping, i.e., thrashing, may occur. The term was first used during the tape operating system days to describe the sound the tapes made when data was being rapidly written to and read from them. Many older low-end computers have insufficient RAM (memory) for modern usage patterns and increasing the amount of memory can often cause the computer to run noticeably faster. This speed increase is due to removing the need for paging.

An example of this sort of situation occurred on the IBM System/360 series mainframe computer, in which a particular instruction could consist of an execute instruction, which crosses a page boundary, that the instruction points to a move instruction, that itself also crosses a page boundary, targeting a move of data from a source that crosses a page boundary, to a target of data that also crosses a page boundary. The total number of pages thus being used by this particular instruction is eight, and all eight pages must be present in memory at the same time. If the operating system allocates less than eight pages of actual memory in this example, when it attempts to swap out some part of the instruction or data to bring in the remainder, the instruction will again page fault, and it will thrash on every attempt to restart the failing instruction.

To resolve thrashing due to excessive paging, a user can do any of the following.
#Increase the amount of RAM in the computer (generally the best long-term solution).
#Decrease the number of programs being run on the computer.

The term is also used when a small set of faster storage space, intended to be used to speed up access to a larger set of slower storage space, is accessed in a way that cancels out any benefits from the faster storage. An example of this is cache thrashing, where main memory is accessed in a pattern that leads to multiple main memory locations competing for the same cache lines, resulting in excessive cache misses. This is most problematic for caches that have low associativity.

Cause of Thrashing

Thrashing results in several performance problems. Consider the following scenario, which is based on actual behavior of early paging systems.

The operating system monitors CPU utilization. If the CPU utilization is too low, we increase the degree of multiprogramming by introducing new processes to the system. A global page-replacement algorithm is used; it replaces pages without regard to the process which they belong. Now suppose that a process enters a new phase in its execution and needs more frames. Its starts faulting and taking frames away from other processes. These processes need those pages, however, and so they also fault, taking frames away from other processes. These faulting processes must use the paging device to swap pages in and out. As they queue up for the paging device, the ready queue empties. As the processes wait for the paging device, CPU utilization decreases.

The CPU scheduler sees the decreasing CPU utilization and increases the degree of multiprogramming as a result. The new process tries to get started by taking frames from running processes, causing more page faults and a longer queue for the paging device. As a result CPU utilization drops even further, and CPU scheduler tries to increase the degree of multiprogramming even more. Thrashing has occurred, and system throughput plunges. The page fault rate increases tremendously. As a result, the effective memory-access time increases. No work is being done.

Limiting the effect of Thrashing

The effect of thrashing can be limited by using a local replacement algorithm. With local replacement, if one process starts thrashing, it cannot steal frames from another process and cause the latter to thrash as well. However, the problem is not entirely solved. If the processes are thrashing they will be in the queue for the paging device. The average service time for a page fault will increase because of the longer average queue for the paging device. Thus, the effective access time will increase even for a process that is not thrashing.

To prevent thrashing, a process must be provided with as many frames as it needs. The number of frames it needs can be determined with several techniques, including the working-set strategy. This approach defines the locality model of process execution.

References

*M. Morris Mano and Charles R. Kime, "Logic and Computer Design Fundamentals", pp. 622.
*P. J. Denning. 1968. Thrashing: Its Causes and Prevention. Proceedings AFIPS,1968 Fall Joint Computer Conference, vol. 33, pp. 915-922.
*Abraham Silberschatz, Peter Baer Galvin and Greg Gagne. "Operating System Principles", pp. 331, 348-353.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Thrashing (computer science) — In computer science, thrashing is a situation where large amounts of computer resources are used to do a minimal amount of work, with the system in a continual state of resource contention.[1][2][3] Once started, thrashing is typically self… …   Wikipedia

  • Thrash — may refer to:*Thrash (computer science), where increasing resources are used to do a decreasing amount of work *Thrash (mascot), mascot of the Atlanta ThrashersIn music: *Thrash metal, a subgenre of heavy metal music:*Crossover thrash, a subgenre …   Wikipedia

  • LURCH — is a tool for software design debugging that uses a nondeterministic algorithm to quickly explore the reachable states of a software model. By performing a partial and random search, LURCH looks for faults in the model and reports the pathways… …   Wikipedia

  • Thrashing — The term thrashing may refer to: * Thrash (computer science), an effect of resource contention, or an extensive test of software * A severe corporal punishment * A clear victory * The dance style moshing * Threshing, a process in agriculture *… …   Wikipedia

  • List of Georgia Institute of Technology alumni — [cite web|url=http://gtalumni.org/uploads/bylaws.pdf|title=Bylaws of the Georgia Tech Alumni Association, Inc.|publisher=Georgia Tech Alumni Association|accessdate=2007 05 03|format=PDF] The first class of 128 students entered Georgia Tech in… …   Wikipedia

  • Paging — This article is about computer virtual memory. For the wireless communication devices, see Pager . Bank switching is also called paging. Page flipping is also called paging. For calling people in a public place see Public address. In computer… …   Wikipedia

  • Anexo:Falsos amigos — Los falsos amigos son palabras que, a pesar de tener significados diferentes, pueden escribirse o pronunciarse de una manera similar en dos o más idiomas. Lo anterior puede deberse tanto a distintas etimologías como a un cambio en el significado… …   Wikipedia Español

  • Equinox (disambiguation) — An equinox in astronomy is the event when the Sun can be observed to be directly above the equator.Equinox may also refer to:Astronomy* Equinox (celestial coordinates), a moment of time chosen for a moving celestial coordinate system such as… …   Wikipedia

  • Falsos amigos — Anexo:Falsos amigos Saltar a navegación, búsqueda Los falsos amigos son palabras que pueden escribirse o tener una pronunciación similar en dos o más idiomas, pero en realidad significan conceptos diferentes, debido a sus distintas etimologías, o …   Wikipedia Español

  • Mike Mangini — during a clinic at the Percussive Arts Centre, Singapore, November 2004 Background information Birth name Michael M …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”