in Operating System edited by
9,403 views
30 votes
30 votes

Dirty bit for a page in a page table

  1. helps avoid unnecessary writes on a paging device
  2. helps maintain LRU information
  3. allows only read on a page
  4. None of the above
in Operating System edited by
9.4k views

4 Comments

Can I say that Option A means:

Helps Avoid Unnecessary Writes On The Disk (Secondary Memory) Where The Page Is Present. ?

2
2
Exactly :)
1
1
I understood why A is correct.

But why is B not correct?

I mean can we not find out the Least Recently used page by seeing if the dirty bit is unmodified.
0
0

No, @debnath we can’t.

Read this on pg 5: https://www.cs.vu.nl/~ast/books/mos2/sample-4.pdf

0
0

3 Answers

55 votes
55 votes
Best answer

The dirty bit allows for a performance optimization. A page on disk that is paged in to physical memory, then read from, and subsequently paged out again does not need to be written back to disk, since the page hasn't changed. However, if the page was written to after it's paged in, its dirty bit will be set, indicating that the page must be written back to the backing store answer: (A)

edited by

4 Comments

Sir, rather than it helps avoid unnecessary writes on a paging device, it should be it helps identifying unnecessary writes for a paging device, isn’t it ?

Because if dirty bit is set to 1 then it resembles that the data had been modified or corrupted which might result into unexpected results, so it basically helps in prevention and not in avoidance. Though option A seems correct too, but if we look at option (D) then it too seems correct. Please help if I am wrong.
0
0
Hey, Can anyone tell me, does  paging device refers to disk?
0
0
Yes, in a virtual memory system, paging is the act of transferring pages between physical memory and backing store (usually disk).
1
1
22 votes
22 votes
ans is A...to perform any write operation on page firstly we check the dirty bit status...dirty bit will be set when page will be modified(suppose s=1 set condition) and it will remain s=1(set) until the page modified will write back into the memory..if page was not modified then it will not change the dirty bit value i.e.s=0...now  suppose we perform write operation on page then its dirty bit become s=1..and suppose after some time we were performing write operation on that page then firstly we check the dirty bit value here its value is 1 it means page was modified..so firstly we write that page to memory and then perform any modification by this way we were avoiding unnecessary write operation on paging device

2 Comments

You mentioned

dirty bit value here its value is 1 it means page was modified..so firstly we write that page to memory and then perform any modification by this way we were avoiding unnecessary write operation on paging device

If we need to perform 100 writes on a page then every time we will write it to memory is wastage. Although your answer is correct but i think we can perform write on the page as many times as we want.Its just when we are about to replace page we will check if dirty bit=1,then write to memory back else dont.If every time before write i check dirty bit=1,then i write page to memory and then do any modification then how is it avoding unnecessary write to memory?

7
7
true, when we do replacement only, so that the final modifications reflected back in memory.
1
1
0 votes
0 votes

Suppose if we don't have "Dirty but concept" then whenever page fault occurs, the page has to be written back first in secondary memory in order to assure consistency ( even though the page may or may not be modified ).

Now if we have "Dirty bit concept" then by examining it's status it can be concluded whether the page should be written back in secondary memory or not whenever page fault occurs. In this manner "Dirty bit helps avoid unnecessary writes on paging device"

So (A) is correct 

Answer:

Related questions