2

The definition of a MDL from Microsoft is:

The operating system uses a memory descriptor list (MDL) to describe the physical page layout for a virtual memory buffer.

The definition of a Page Table Entry (PTE) on Wikipedia is:

A page table is the data structure used by a virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses.

These two definitions seem very similar, yet I am unable to find the differences between these two types of data structures.

1 Answer 1

3

Similar yet different.

A Paging Table is used to interpret an address in a particular programs Virtual Address Space into Machine Address Space (or a trap into the kernel to map it). It is often Hardware accelerated.

A Memory Descriptor List contains Pages in Machine Address Space that are in contiguous Virtual Address order of the Virtual Address Space they were lifted from, which may be from any process. These are used by device drivers to perform IO either to or from a process. AN MDL is essentially a glorified buffer. Importantly this buffer may no longer or not yet exist in the Virtual Address Space of a user land process.

For example (and this is contrived to almost breaking point) a process may request a file to be memory mapped.

  • The call is handled by a device driver. It reserves a contiguous range of Virtual Memory in the process to represent the file (updates the Paging Table).
  • The process attempts to access the first page.
  • The Paging Table has no physical address registered, and traps into the kernel.
  • The device driver is handed an MDL representing that Virtual Page.
  • It then loads the first page from disk updating the MDL.
  • It then updates the Paging Table for the process using the MDL.

This is probably not how modern operating systems achieve this. I can imagine more contextually elegant methods.

The main take aways are that:

  • the Paging Table handles the Full Virtual Address Space of a process. If its not there, its not in that process.
  • the MDL handles a buffer of Virtually Contiguous, but physically discontiguous pages. Those pages do not have to exist in a user land process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.