Hi all,
I’ve been talking about File Systems Drives recently and a friend has asked me about the difference between Modified Pages and Dirty Pages. As far as I could understand, they are the same thing described on different ways. But he brought me an Windows Internals Book that says:
“… If the user maps a view of a file that is also open in the cache, when the view is unmapped, the modified pages are marked as dirty so that when the lazy writer thread later flushes the view, those dirty pages will be written to disk.” (Windows Internals 5th page 884).
What am I missing?
TIA,
Fernando Roberto da Silva
DriverEntry Kernel Development
> I’ve been talking about File Systems Drives recently and a friend has
asked me
about the difference between Modified Pages and Dirty Pages. As far as I
could
understand, they are the same thing described on different ways.
Me too. But I wish I could remember the distinction between the Modified
Page Writer and Mapped Paged Writer since I think that at the edges of the
envelope this is part of the distinction (was it 4.0 or W2K that the Mapped
Page Writer was introduced to get rid of a Deadlock)>
“… If the user maps a view of a file that is also open in the cache,
when the view is unmapped, the modified
pages are marked as dirty so that when the lazy writer thread later
flushes the view, those dirty pages will
be written to disk.” (Windows Internals 5th page 884).
SWAG: I assume that in this case the “dirty” is to do with the Cache
Manager since it seems to infer that CcLazyWriter will write the pages which
it will only do if it thinks that the *cache* is dirty. Modified would then
be the pure PFN state (and modulo the CacheManager wouldthen be written out
by either the Mapped or Modified Page Writer.
Can anyone else help?
R
Thanks Rod,
The Windows NT File System Internals (page 225) says the difference between Modified Page Writer and Mapped Page Writer is that “Mapped” deals with mapped file and “Modified” with page file (pagefile.sys).
They’re very similar on their behavior and they are referred interchangeably in the book.
This section says on page 225: “The NT VMM automatically flushes dirty or modified pages to secondary storage to reclaim frames for use by other threads in the system.”
Att,
Fernando Roberto da Silva
DriverEntry Kernel Development
http:\www.driverentry.com.b
There can be a PTE marked as dirty and a PFN marked as dirty.
These things are different, and maintaining them are a must to handle the scenario of “other thread re-dirties the same pages while they are in the process of being paged out”.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntfsd…
> Hi all,
>
> I’ve been talking about File Systems Drives recently and a friend has asked me about the difference between Modified Pages and Dirty Pages. As far as I could understand, they are the same thing described on different ways. But he brought me an Windows Internals Book that says:
>
> “… If the user maps a view of a file that is also open in the cache, when the view is unmapped, the modified pages are marked as dirty so that when the lazy writer thread later flushes the view, those dirty pages will be written to disk.” (Windows Internals 5th page 884).
>
> What am I missing?
>
> TIA,
> –
> Fernando Roberto da Silva
> DriverEntry Kernel Development
>
>
>
>
The bit in the PTE is named “Dirty” and the bit in the PFN is named
“Modified”, this could be part of the confusion. The bit in the PTE is set
by both the hardware (on write to the VA) and the OS (when necessary). When
the virtual address range is flushed or unmapped, the Dirty PTE bit is
“pushed out” to the PFN (i.e. the Modified bit gets set). These PFNs with
the modified bit are then written out by one of the page writers: Mapped for
file back sections and Modified for pagefile backed sections.
Cached I/O uses file backed sections under the hood, so there is much
interaction between the Cache Manager and the Memory Manager. The Cache
Manager also has its own background writing activity (the Lazy Writer),
which coordinates with the Mapped Page Writer to flush the dirty/modified
data out to disk. A benefit of doing this is that we can (attempt to) write
the data out to the file system in file order as opposed to memory order.
-scott
OSR
@OSRDrivers
“Maxim S. Shatskih” wrote in message news:xxxxx@ntfsd…
There can be a PTE marked as dirty and a PFN marked as dirty.
These things are different, and maintaining them are a must to handle
the scenario of “other thread re-dirties the same pages while they are in
the process of being paged out”.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntfsd…
> Hi all,
>
> I’ve been talking about File Systems Drives recently and a friend has
> asked me about the difference between Modified Pages and Dirty Pages. As
> far as I could understand, they are the same thing described on different
> ways. But he brought me an Windows Internals Book that says:
>
> “… If the user maps a view of a file that is also open in the cache,
> when the view is unmapped, the modified pages are marked as dirty so that
> when the lazy writer thread later flushes the view, those dirty pages will
> be written to disk.” (Windows Internals 5th page 884).
>
> What am I missing?
>
> TIA,
> –
> Fernando Roberto da Silva
> DriverEntry Kernel Development
>
>
>
>