Re: Doubt regarding memory

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

 



On Tuesday 27 February 2007 21:22, Sandeep Sanjay Patil wrote:
>    Well, im afraid you are getting it all wrong. What rajat said was,
> identity mapping with an offset of 0xc0000000 most of the times , which
> means eg.
>   If you have your ram of 512mb physical address from 0x10000000 -
> 0x30000000, your kernel will map the same from linear address(virtual)

Why did you start from 0x10000000 and not from 0x0?

> 0xc0000000 - 0xf0000000. So, its 512mb of virtual space, mapped down to

You probably meant 0xc0000000 - 0xe0000000

> 512 mb of physical addresses here. So
>    0xc0000000 ---> 0x10000000
>    0xd0000000 ---> 0x20000000 etc.
> And yes, 512 mb of physical ram means there wont be a need for HIGH_MEM
> on the comuter. Because it will only be used if you have physical memory
> more that that of the range of ZONE_NORMAL i.e. 896mb.
>
> > Regarding 0xc0000000, in decimal it is something like 3,221,225,472
> > addresses (i.e, i think it is 3gb). How does it relate to dma and normal
> > zone i don't understand. From ldd3, the dma zone is 0-16mb and normal is
> > up till 896mb in x86 which is far less than 1gb. Which, btw, i also does
> > not understand this number, why 3gb and not 1gb, the kernel works
> > backwards? i.e. starts from 4gb and the dma and normal space is from
> > 4gb-3gb and the high mem is from 3gb-0?
>
>   The ZONE_DMA is first 16mb of ram, because ISA (not sure aboout the
> PCI though, experts please chip in) busses, could only address memory
> using 24-bits, Since the DMA accepts physical addresses, and busses wont
> recognize any greater that 2^24, the DMAable memory restricts down to
> 2^24 = 16mb. and thus ZONE_DMA.
>
>    Again, kernel tries to map the whole of physical memory available in
> an address range of 0xc0000000 - 0xffffffff. however, if its more than
> 896 mb, it has to use the last 128mb of virtual address space to map in
> the extra physical memory in and out dynamically, and thts your
> ZONE_HIGH_MEM.

So what you are saying that on a 1gb,2gb,..,4gb ram, ZONE_HIGH_MEM will always 
be 128mb. However, those 128mb in the MMU will not enjoy identity mapping 
(i.e. will have to use page tables entries translations). In addition, if we 
have 4gb ram, the additional physical 3gb after the first 1gb. i.e. 
0x40000000 - 0xffffffff will be mapped to virtual addresses 0x0 - 0xc0000000?
(major weirdness btw).

Btw, when i only have 512mb. Does that mean that the virtual address which is 
in excess of the virtual-physical ram identity mapping, (if i have enough 
swap space) will be from 0x0-0xc0000000?

Btw, is it also possible for two processes to have the same virtual address 
and context switch will redirect each time (using different page table of the 
process) the same virtual address to different physical address.

10x for your consistent patience :).

>
>    And no, the kernel doest work _backwards_ ;-)
>
> cheers,
> sandeep

-- 
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at 
http://members.lycos.co.uk/my2nis/spamwarning.html

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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