Dirty bit


Why Dirty Bit? What is Dirty Bit?

In order to reduce the page fault service time, a special bit called the dirty bit can be associated with each page.

The dirty bit is set to “1” by the hardware whenever the page is modified. (written into).
When we select a victim by using a page replacement algorithm, we examine its dirty bit. If it is set, that means the page has been modified since it was swapped in. In this case we have to write that page into the backing store.

However if the dirty bit is reset, that means the page has not been modified since it was swapped in, so we don’t have to write it into the backing store. The copy in the backing store is valid.

Let the probability of a page being dirty be d. In this case effective access time becomes:

eat = p * ( (1-d) * swap_in + d * (swap_in + swap_out) ) + (1 – p) * emat

Try Now – Operating Systems MCQs
Practice Now – Operating System Online Test