Dirty bit: Difference between revisions
Guy Harris (talk | contribs) Undid revision 622936200 by 14.139.226.3 (talk) - rv damage |
|||
Line 1: | Line 1: | ||
{{For|the [[Black Eyed Peas]] song|The Time (Dirty Bit)}} |
{{For|the [[Black Eyed Peas]] song|The Time (Dirty Bit)}} |
||
A '''dirty bit''' or '''modified bit''' is a [[bit]] that is associated with a block of computer memory and indicates whether or not the corresponding block of memory has been modified.<ref>{{cite book|first1=Philip A.|last=Laplante|title=Dictionary of Computer Science, Engineering, and Technology|year=2001|publisher=[[CRC Press]]|isbn=0-8493-2691-5|page=138}}</ref> The dirty bit is set when the [[Central processing unit|processor]] writes to (modifies) this memory. The bit indicates that its associated block of memory has been modified and has not yet been saved to [[secondary memory| storage]]. When a block of memory is to be replaced its corresponding dirty bit is checked to see if the block needs to be written back to secondary memory before being replaced or if it can simply be removed. Dirty bits are used by the [[CPU cache]] and in the [[page replacement algorithm]]s of an [[operating system]]. |
A '''dirty bit''' or '''modified bit''' is a [[bit]] that is associated with a [[Block (data storage)|block]] of computer memory and indicates whether or not the corresponding block of memory has been modified.<ref>{{cite book|first1=Philip A.|last=Laplante|title=Dictionary of Computer Science, Engineering, and Technology|year=2001|publisher=[[CRC Press]]|isbn=0-8493-2691-5|page=138}}</ref> The dirty bit is set when the [[Central processing unit|processor]] writes to (modifies) this memory. The bit indicates that its associated block of memory has been modified and has not yet been saved to [[secondary memory| storage]]. When a block of memory is to be replaced its corresponding dirty bit is checked to see if the block needs to be written back to secondary memory before being replaced or if it can simply be removed. Dirty bits are used by the [[CPU cache]] and in the [[page replacement algorithm]]s of an [[operating system]]. |
||
== Page replacement == |
== Page replacement == |
Revision as of 19:54, 30 September 2014
A dirty bit or modified bit is a bit that is associated with a block of computer memory and indicates whether or not the corresponding block of memory has been modified.[1] The dirty bit is set when the processor writes to (modifies) this memory. The bit indicates that its associated block of memory has been modified and has not yet been saved to storage. When a block of memory is to be replaced its corresponding dirty bit is checked to see if the block needs to be written back to secondary memory before being replaced or if it can simply be removed. Dirty bits are used by the CPU cache and in the page replacement algorithms of an operating system.
Page replacement
When speaking about page replacement, each page (frame) may have a modify bit associated with it in the hardware. The dirty bit for a page is set by the hardware whenever any word or byte in the page is written into, indicating that the page has been modified. When we select a page for replacement, we examine its modify bit. If the bit is set, we know that the page has been modified since it was read in from the disk. In this case, we must write that page to the disk. If the dirty bit is not set, however, the page has not been modified since it was read into memory. Therefore, if the copy of the page on the disk has not been overwitten (by some other page, for example), then we can avoid writing the memory page to the disk: it is already there.[2]
References
- ^ Laplante, Philip A. (2001). Dictionary of Computer Science, Engineering, and Technology. CRC Press. p. 138. ISBN 0-8493-2691-5.
- ^ Silberschatz, Abraham; Galvin, Peter Baer; Gagne, Greg (2002). Operating System Concepts: Sixth Edition. p. 333. ISBN 0-471-41743-2.