由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - A question about page table
相关主题
[合集] 哪本C++书有讲virtual table的呢?C下有没有好用的hash table函数库?
map shared memory to local processc++ stl里面有hash table吗?
问个小问题怎么把hash of hash 存到数据库里?
uber使用的是神马框架?一个C++的问题
Windows IO driver处理IRP问题ld的问题
linux内存分配中page的几个问题一个hash table的简单问题
SQL question[合集] perl symbol tables 一问
How to update linked table in Access?问个SQL的问题
相关话题的讨论汇总
话题: page话题: table话题: process话题: virtual话题: question
进入Programming版参与讨论
1 (共1页)
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.

1 (共1页)
进入Programming版参与讨论
相关主题
问个SQL的问题Windows IO driver处理IRP问题
我的DBA在生成ORACLE table的时候需要一个一个column看 (转载)linux内存分配中page的几个问题
typedef const char *month Table[3]SQL question
C# table的内部gridline为什么出不来呢?How to update linked table in Access?
[合集] 哪本C++书有讲virtual table的呢?C下有没有好用的hash table函数库?
map shared memory to local processc++ stl里面有hash table吗?
问个小问题怎么把hash of hash 存到数据库里?
uber使用的是神马框架?一个C++的问题
相关话题的讨论汇总
话题: page话题: table话题: process话题: virtual话题: question