Re: size of page table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi scgkiran,
  we need a excatly 12 bits to access any offset with in the page how did 
u get 9 bits.
generally pagetable entry also contain some additional bits for the 
control information ie(read-only page,read-write etc..),along with 
VPFN(virtual page frame number) and PFN(physical frame number) ,The number 
of PFN's depend on the ramsize.and the number of VPFN's depend on the 
virtual address space.

now we have 2 options for the number of pagetable entries

 1.we can make the number of entries in the pagetable equal to PFN
	in this case the number of PFN's are (64MB/4kB =16KB).
	so the number of entries are 16KB. now let us consider the entry 
	size. the first 20 bits for every logical address correspond to 
	VPFN's and we need 14 bits(16kB) to uniquely identify a PFN for a 
	VPFN,So we have 20+14 = 34 bits lets assume there are 6 control 
	bits so every pagetable entry takes 5 bytes. and the number of 
	entries are equal to PFN's so the size is 5*2^14 bytes =80KB.
2.if the number of entries is equal to VPFN's the we have 5MB. (we have 
1MB of VPFN's ie 32GB/4KB.

 	
if i'am  wrong any where  please correct me.

reguards
vamsi krishna

On Mon, 6 Jan 2003, Chandra G K Babu S wrote:

> 
> the answer is 8mb, may be that is a one level page table.
> the page size is 4kb (=4k * 1/8 = 1/2kB)
> 32 bits of virtual address divided as 23+9,
>  first 23 bits give the page number,
> the 9 bits give the index in a page. the page table have to
>  accomdate (2 pow 23) entries so the page table size is 8 mb.
> 
> i think this question ha nothing to do with the linux.
> any comments?
> 
> with regards,
> kiran
> On Mon, 6 Jan 2003, Rupa wrote:
> 
> > 
> > Actually this was the question asked in some exam. I do no how to calculate
> > size of page table. They had given 4 answers...
> > i)16mb ii)8mb
> > iii)2mb iv) 24mb
> > 
> > You have any idea?
> > 
> > Regards,
> > Rupa
> > ----- Original Message -----
> > From: "Raghu R. Arur" <rra2002@cs.columbia.edu>
> > To: "Rupa" <rupa.ramakrishna@ionidea.com>
> > Sent: Monday, January 06, 2003 11:47 AM
> > Subject: Re: size of page table
> > 
> > 
> > >
> > > Hi,
> > >
> > >  If you are talking about linux, the page table size is not related to the
> > > memory size (RAM size). page table is for per process and in linux each
> > > process will have 4GB of memory allocated. 3 GB for the user space and 1
> > > GB for the kernel space.
> > >
> > >  HTH,
> > > raghu
> > >
> > > On Mon, 6 Jan 2003, Rupa wrote:
> > >
> > > > Hello,
> > > >     I have small doubt regarding the sizeof page table. Consider a
> > machine with 64MB physical memory and a 32 bit virtual address space. If the
> > page size is 4kb, what is the approximate size of page table.?
> > > > Any help will be useful
> > > >
> > > > Rupa
> > > >
> > >
> > 
> > --
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive:       http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
> > 
> 
> 

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 1.2
GCS d+ H- s g+++ !p !au a21 w-- v--- C++ U+++ P++ L+++ !3 N--
E- W M- !VMS po+++ t-- !5 !j R- G? !tv b++++
-----END GEEK CODE BLOCK-----

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux