hai all,
Please help me to understand the difference between Pagetables and VAD.
-
In NT, Virtual to physical translation is done ,using page directory and page tables. PeterV’s book also says that VAD describes a range of virtual pages in an address space. What kind of information does the VAD contains?
-
Will every address spcae have a VAD?
regards
Deepu.L.R.
VAD contains:
- starting VA
- length
- is it mapped to a section object or not (private memory)
- reserved/commited flags.
Page tables are created dynamically on faults, with VAD “consulting” involved in this.
Max
----- Original Message -----
From: Deepu.L.R
To: NT Developers Interest List
Sent: Monday, January 13, 2003 9:18 AM
Subject: [ntdev] Virtual address descriptors
hai all,
Please help me to understand the difference between Pagetables and VAD.
-
In NT, Virtual to physical translation is done ,using page directory and page tables. PeterV’s book also says that VAD describes a range of virtual pages in an address space. What kind of information does the VAD contains?
-
Will every address spcae have a VAD?
regards
Deepu.L.R.
You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
VAD is a binary tree where each node of the tree corresponds to a range of
virtual addresses of the process. Every process(to be precise process’s address space) will have VAD tree.
When a page is loaded into memory as a result of a page fault,the memory manager will
create a new entry in the VAD tree to represent this physical page. This entry
actually describes the place(it may be a file on disk) from where this new page was loaded into memory.
When h/w generates a page fault,the memory manager
allocates a new physical page to satisfy this page fault. The memory manager has to populate
this new page with valid data. So how does the memory manager know
where to load the data for this page from??
As u know an invalid page table entry(PTE) has different structures depending
on where the data is backed up.
(Invalid PTE is a PTE which references an invalid i,e non existent page).
When the data is backed by a paging file,4 of the bits in the PTE
are used to describe the paging file which stores the data.In this case the memory
manager will load the data from this paging file into the newly allocated page.
Instead of a paging file the page of memory might be in an executable file
on disk.
In this case the PTE structure changes so that 28 bits out of the PTE’s 32 bits
will be used to locate the data to be loaded.
These 28 bits will be used to traverse the VAD tree to locate an entry in the tree
which references the name of the file(name of the file on disk) and a location within the file for the page of memory.
To conclude, VMM figures out what should be at a particular
address by consulting the virtual address descriptor (VAD) that covers
the faulting address.
rgds
Sankarshana M
----- Original Message -----
From: Deepu.L.R
To: NT Developers Interest List
Sent: Sunday, January 12, 2003 10:18 PM
Subject: [ntdev] Virtual address descriptors
hai all,
Please help me to understand the difference between Pagetables and VAD.
-
In NT, Virtual to physical translation is done ,using page directory and page tables. PeterV’s book also says that VAD describes a range of virtual pages in an address space. What kind of information does the VAD contains?
-
Will every address spcae have a VAD?
regards
Deepu.L.R.
You are currently subscribed to ntdev as: xxxxx@hotmail.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
>VAD is a binary tree where each node of the tree corresponds to a
range of
virtual addresses of the process. Every process(to be precise
process’s address space) will
have VAD tree.
Yes. VADs are created by VirtualAlloc and MapViewOfFile and deleted by
appropriate counterparts.
The main purposes of the VAD tree is:
- placeholders for address space ranges
- an information about whether the page fault must cause an exception
(outside of commited VADs) or must be handled.
When a page is loaded into memory as a result of a page fault,the
memory manager will
create a new entry in the VAD tree to represent this physical page.
Wrong.
A new PTE in the PTE table is created, and yes, the VAD tree can be
consulted during this. Nevertheless, VAD tree is not changed as result
of page faults.
this new page with valid data. So how does the memory manager know
where to load the data for this page from??
For private page - the swapfile address is in the invalid form of PTE.
For shared page - the invalid form of PTE points to prototype PTE,
which can contain the physical address or swapfile address or the
indicator that this is a mapped-file page, in this case, file object
is taken from the PPTE segment header, and the offset is computed,
based on the location of the PPTE in the segment.
Max
Max, sankar
thanks it is very helpfull.
Deepu.L.R
----- Original Message -----
From: “Maxim S. Shatskih”
To: “NT Developers Interest List”
Sent: Tuesday, January 14, 2003 6:35 AM
Subject: [ntdev] Re: Virtual address descriptors
> >VAD is a binary tree where each node of the tree corresponds to a
> range of
> >virtual addresses of the process. Every process(to be precise
> process’s address space) will
> >have VAD tree.
>
> Yes. VADs are created by VirtualAlloc and MapViewOfFile and deleted by
> appropriate counterparts.
> The main purposes of the VAD tree is:
> - placeholders for address space ranges
> - an information about whether the page fault must cause an exception
> (outside of commited VADs) or must be handled.
>
> >When a page is loaded into memory as a result of a page fault,the
> memory manager will
> >create a new entry in the VAD tree to represent this physical page.
>
> Wrong.
> A new PTE in the PTE table is created, and yes, the VAD tree can be
> consulted during this. Nevertheless, VAD tree is not changed as result
> of page faults.
>
> >this new page with valid data. So how does the memory manager know
> >where to load the data for this page from??
>
> For private page - the swapfile address is in the invalid form of PTE.
>
> For shared page - the invalid form of PTE points to prototype PTE,
> which can contain the physical address or swapfile address or the
> indicator that this is a mapped-file page, in this case, file object
> is taken from the PPTE segment header, and the offset is computed,
> based on the location of the PPTE in the segment.
>
> Max
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@m2comsys.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
Just to add a warning wrt VAD descriptorts.
A memory address range submitted for I/O that may result in MmProbeAndLockPages()
will fail on Win2K (and XP ?) if memory address range is covered by more than
one VAD. This behavor does not occur in NT3.51/NT4.
Example, construct contiguous virtual address range using two consecutive
VirtualAlloc() calls and attempt to execute UNBUFFERED Read or Write to/from file using
thant memory and you will get I/O failure.
ned
“Deepu.L.R” wrote:
Max, sankar
thanks it is very helpfull.
Deepu.L.R
----- Original Message -----
From: “Maxim S. Shatskih”
> To: “NT Developers Interest List”
> Sent: Tuesday, January 14, 2003 6:35 AM
> Subject: [ntdev] Re: Virtual address descriptors
>
> > >VAD is a binary tree where each node of the tree corresponds to a
> > range of
> > >virtual addresses of the process. Every process(to be precise
> > process’s address space) will
> > >have VAD tree.
> >
> > Yes. VADs are created by VirtualAlloc and MapViewOfFile and deleted by
> > appropriate counterparts.
> > The main purposes of the VAD tree is:
> > - placeholders for address space ranges
> > - an information about whether the page fault must cause an exception
> > (outside of commited VADs) or must be handled.
> >
> > >When a page is loaded into memory as a result of a page fault,the
> > memory manager will
> > >create a new entry in the VAD tree to represent this physical page.
> >
> > Wrong.
> > A new PTE in the PTE table is created, and yes, the VAD tree can be
> > consulted during this. Nevertheless, VAD tree is not changed as result
> > of page faults.
> >
> > >this new page with valid data. So how does the memory manager know
> > >where to load the data for this page from??
> >
> > For private page - the swapfile address is in the invalid form of PTE.
> >
> > For shared page - the invalid form of PTE points to prototype PTE,
> > which can contain the physical address or swapfile address or the
> > indicator that this is a mapped-file page, in this case, file object
> > is taken from the PPTE segment header, and the offset is computed,
> > based on the location of the PPTE in the segment.
> >
> > Max
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@m2comsys.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
> —
> You are currently subscribed to ntdev as: xxxxx@colorbus.com.au
> To unsubscribe send a blank email to xxxxx@lists.osr.com