Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
962 views
in Technique[技术] by (71.8m points)

operating system - How does dirtybit maintained?

As far as I know the dirty bit is there to help determine if the page content is consistent with the one of the hard drive, so if it's set to 1 then the page in the memory is more updated then the one in the hard drive, so at some point the OS will write it to the hard drive to update.

furthermore, I know the the hardware(MMU I think) set this bit to 1 when write to this page, and the OS clears is when it updates the page in the hard drive.

I also know that there can be multiply process that map to the same page, so each one of them has his own page table those his own mapping from Virtual address to this Physical page.

so my questions is :

so what happen when one process modify the content, than the MMU set the dirty bit to 1 in this specific mapping. but then mapping to the physical page on the other process is with dirty bit 0. Than how does the OS knows if it's dirty or not when it paged out? Does it use the reverse mapping to each page table entry from this specific physical page to check if it's dirty and if one of them is dirty then it updates it on the hard disk? it sounds costly and inefficient.

Thanks.

question from:https://stackoverflow.com/questions/65872169/how-does-dirtybit-maintained

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...