Question

So this is not a homework question. It's a question from a previous exam my professor posted as resource to help us study for our midterm. However, there are two answers that (to me) seem like they could be the correct answer.

A.) A page fault means the physical page to be replaced must be saved to the hard disk. B.) The requested virtual is not in the physical memory.

Now, it is my understanding that a page fault is when the data stored in the physical memory page is not the data you need, therefore, you need to access the hard drive and load the correct data. Also, if the dirty flag is 1, then that means the previous data in physical memory has been modified, therefore you need to re-save that to the disk.

Therefore, it seems to me that both A and B are right, but I was wondering if anyone could tell me what they think the better option is.

If I were forced to choose I would say A.

SIDE NOTE I have emailed the professor about the answer but he's really bad about responding and hasn't emailed me back yet.

Was it helpful?

Solution

Neither of these is correct.

A.) A page fault means the physical page to be replaced must be saved to the hard disk.

This is not correct because it could also mean the page needs to be read from the hard disk.

B.) The requested virtual is not in the physical memory.

This is not correct because in a soft page fault, the page is resident in physical memory. For example, the operation may just be the first write to a resident, unshared page, so the page has to be marked dirty. Or the page may be shared and need to be unshared. In these cases, the requested virtual page is resident in physical memory, it just needs some massaging by the memory management system.

A page fault means some help from the kernel is needed in order to permit the access to that page of virtual memory. The help needed could vary from reading the page in to disk to just marking the page accessed so the kernel knows not to evict it.

Of those two, B is probably closer to correct because A is almost never right. The "classic" page fault would be if the page had to be read in from hard disk, which B would apply to but not A.

Now, it is my understanding that a page fault is when the data stored in the physical memory page is not the data you need, therefore, you need to access the hard drive and load the correct data. Also, if the dirty flag is 1, then that means the previous data in physical memory has been modified, therefore you need to re-save that to the disk.

How could the page both be dirty and not hold the data you need? If it's dirty, that means you dirtied it. Which means it's holding the data you're working with.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top