Shared page prototype PTE

> I believe I’m correct in saying that the ‘MmSt’ pool tag is used for prototype PTEs in the paged pool.

I think yes.

I am however a little confused as how this prototype PTE can be used to track the data.

PPTE has a physical address of the page, or some file/pagefile offset if the page is really not in memory.

When the usual PTEs are made invalid, the are switched to point to the PPTE.

If the page is shared (i.e. several PTEs), then in the end you will have all usual PTEs in the state of “invalid, the reference to PPTE”, and also a PPTE.

Resolving a page fault on such a PTE is just making it valid (using the physaddr from the PPTE) and bumping the page’s refcount.

If several PTEs are faulted on, then they will use the same physaddr (from the PPTE), so the page is really shared.

In order to support the PTE valid->invalid transition, the PFN entry for a PPTE-referenced page contains the pointer to the PPTE (to be put to PTE when it is invalidated).

I’m not entirely sure what’ I’m looking at here, I thought it might be a _SECTION_OBJECT, but I’m not

SECTION_OBJECT is just a) access rights flags b) a ref to Control Area (MmCa for usual sections, MmCi for PE binary SEC_IMAGE sections).

Control Area keeps a list of MmSt “segments” (PPTE tables).

Also, each file’s FCB has SECTION_OBJECT_POINTERS, where the pointers to MmCa and MmCi are stored. This allows the FSD to guarantee 1 and not more then 1 MmCa for any on-disk file.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com