e******d 发帖数: 310 | 1 I have a question about page table.
Assume we have two processes A, and B.
In process A we have a virtual address, say, 0x8243_AB25;
In process B we have the same virtual address 0x8243_AB25;
My question is if these two virtual addresses in process A and B point to
the same physical memory location?
More specifically, how is the page table built and how many page tables are
maintained?
Thank you a lot. | m*****e 发帖数: 4193 | 2
are
One page table per process, and it's platform dependent. Read intel
architecture manual for details on x86/64.
【在 e******d 的大作中提到】 : I have a question about page table. : Assume we have two processes A, and B. : In process A we have a virtual address, say, 0x8243_AB25; : In process B we have the same virtual address 0x8243_AB25; : My question is if these two virtual addresses in process A and B point to : the same physical memory location? : More specifically, how is the page table built and how many page tables are : maintained? : Thank you a lot.
| e******d 发帖数: 310 | 3 Thank you for the reply.
If we need maintain a page table for each process, do the page tables for
the different processes have the same size?
If yes, I have another question. Assume the size of each page table is
4M, then each program needs at least 4M memory. Is that true? When I check
the memory usage of some processes, some just need a few hundred K or even
less memory. | t****t 发帖数: 6806 | 4 so obviously the page table are of different size.
check
even
【在 e******d 的大作中提到】 : Thank you for the reply. : If we need maintain a page table for each process, do the page tables for : the different processes have the same size? : If yes, I have another question. Assume the size of each page table is : 4M, then each program needs at least 4M memory. Is that true? When I check : the memory usage of some processes, some just need a few hundred K or even : less memory.
| X****r 发帖数: 3557 | 5 If you're curious on how page tables are designed and implemented,
why don't you grab a manual for a particular architecture, say x86?
http://www.intel.com/products/processor/manuals/
It should be in
Intel® 64 and IA-32 Architectures Software Developer's Manual
Volume 3A: System Programming Guide
for
check
even
【在 e******d 的大作中提到】 : Thank you for the reply. : If we need maintain a page table for each process, do the page tables for : the different processes have the same size? : If yes, I have another question. Assume the size of each page table is : 4M, then each program needs at least 4M memory. Is that true? When I check : the memory usage of some processes, some just need a few hundred K or even : less memory.
| m*****e 发帖数: 4193 | 6
check
even
I don't remember the theoretical maximum size of the page table, but unless
you use all the pages in the address space, you don't need the full size of
page table.
【在 e******d 的大作中提到】 : Thank you for the reply. : If we need maintain a page table for each process, do the page tables for : the different processes have the same size? : If yes, I have another question. Assume the size of each page table is : 4M, then each program needs at least 4M memory. Is that true? When I check : the memory usage of some processes, some just need a few hundred K or even : less memory.
| X****r 发帖数: 3557 | 7 Right. For example, in i386 page tables have two levels. The
second-level tables only exist for mapped pages.
unless
of
【在 m*****e 的大作中提到】 : : check : even : I don't remember the theoretical maximum size of the page table, but unless : you use all the pages in the address space, you don't need the full size of : page table.
| t****t 发帖数: 6806 | 8 i remember maximum is just 4M...
unless
of
【在 m*****e 的大作中提到】 : : check : even : I don't remember the theoretical maximum size of the page table, but unless : you use all the pages in the address space, you don't need the full size of : page table.
| p****o 发帖数: 1340 | 9 these two addresses are pointing to different places.
only mapped pages are in the pagetbl, and page-table is stored in virtual
address space, so process switching is easy: when the base address is
changed, then magically the pagetbl pointer will point to the new pagetbl.
actually, cache is the hard issue while pagetble not of that much.
are
【在 e******d 的大作中提到】 : I have a question about page table. : Assume we have two processes A, and B. : In process A we have a virtual address, say, 0x8243_AB25; : In process B we have the same virtual address 0x8243_AB25; : My question is if these two virtual addresses in process A and B point to : the same physical memory location? : More specifically, how is the page table built and how many page tables are : maintained? : Thank you a lot.
|
|