Invalid cache buffer question

We are developing a FSFD. We’ve studied Windows internals,4th Edition By Mark &
David. As in the File System Driver Architecture states,“Then CcCopyRead simply copies the file data from the mapped view to the buffer it was passed (the buffer originally
passed to ReadFile). If the file data isn’t in physical memory, the copy operation
generates page faults, which are serviced by MmAccessFault.”
On the other hand,from OSR IFS FAQ states,“If the virtual cache buffer contents are resident in memory, the copy is fast and the results returned to the application quickly.
If the virtual cache buffer contents are not all resident in memory, then the copy
process will trigger a page fault,which generates a second re-entrant I/O operation
via the paging mechanism.”
The Question is: We wanted to let the cache buffer invalid all the time that can make any
application(like file browser) to read/write the files directly by through the disk.
Should we try to invaild PTE? or anyone know how to implement it, Thank you.

Best Regards,

parkerlived

> Should we try to invaild PTE?

No, don’t play with PTE.
Actually in both excerpts( Solomon & Rusinovich’s and OSR’s ) the phrases
“physical memory” and “resident in memory” stand for physical pages(
frames ) and their descriptors ( the internal data structure known as PFN )
but not PTE. In Windows( like in many other OSs ) the physical page( frame )
might not be mapped by any PTE, the mapping is done in a page fault
handler - this is so called “soft” page fault.

We are developing a FSFD.
We wanted to let the cache buffer invalid all the time
or anyone know how to implement it, Thank you.

It is impossible to implement in a simple FSDF, you should consider a FSD
over FSD approach.


Slava Imameyev, xxxxx@hotmail.com

wrote in message news:xxxxx@ntfsd…
> We are developing a FSFD. We’ve studied Windows internals,4th Edition By
> Mark &
> David. As in the File System Driver Architecture states,“Then CcCopyRead
> simply copies the file data from the mapped view to the buffer it was
> passed (the buffer originally
> passed to ReadFile). If the file data isn’t in physical memory, the copy
> operation
> generates page faults, which are serviced by MmAccessFault.”
> On the other hand,from OSR IFS FAQ states,“If the virtual cache buffer
> contents are resident in memory, the copy is fast and the results returned
> to the application quickly.
> If the virtual cache buffer contents are not all resident in memory, then
> the copy
> process will trigger a page fault,which generates a second re-entrant I/O
> operation
> via the paging mechanism.”
> The Question is: We wanted to let the cache buffer invalid all the time
> that can make any
> application(like file browser) to read/write the files directly by through
> the disk.
> Should we try to invaild PTE? or anyone know how to implement it, Thank
> you.
>
> Best Regards,
>
> parkerlived
>