Re: Zones and high memory.

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

 



On Tue, 2007-04-17 at 20:51 +0530, Sandeep Sanjay Patil wrote:
> On Tue, 2007-04-17 at 19:00 +0530, Prasad Joshi wrote:
> > Hi All,
> > 
> > I am confused with the ZONEs and HIGH memory. 
> > 
> > 
> > Memory within ZONE_NORMAL is directly mapped by the kernel into the
> > upper region of the linear address space. This is the physical memory
> > directly accessible by the kernel and is related to the
> > kernel/userspace split in the linear address space marked by
> > PAGE_OFFSET. 
> > 
> > 
> > Why ZONE_NORMAL is directly mapped into upper region of the linear
> > address space? I think here PAGE_OFFSET (3GB) indicates the upper
> > region of the linear address space ?
> 

The starting address(which is 0 most of the time) of the physical memory
is mapped to 0xc0000000 ie from zone_dma.

> So that the kernel can _always_ access mem within ZONE_NORMAL. So, there
> is a possibility that a page in ZONE_NORMAL is mapped in userspace to
> (allocated to a process). So, then that page frame then has two mappings
> one for the process and the other for the kernel itself.
> 
> > 
> > 
> > ZONE_HIGHMEM is the remaining available memory in the system and is
> > not directly mapped by the kernel.
> > 
> > 
> > Generally, 
> > ZONE_DMA First 16MiB of memory
> > ZONE_NORMAL 16MiB – 896MiB
> > ZONE_HIGHMEM 896 MiB – End 
> > 
> > Now, the previous para says ZONE_NORMAL is at PAGE_OFFSET (3GB) but,
> > this table indicates it at 16 MB ? 
> > 
> > Because the address space usable by the kernel (ZONE_NORMAL) is
> > limited in size, the kernel has support for the concept of high
> > memory.

Physical memory is divided into zones(not virtual memory)
so the address space usable by the kernel is virtual address 0xc0000000
to 0xffffffff , which maps directly from phy address 0.


>  Two thresholds of high memory exist on 32-bit x86 systems, one
> > at 4GiB and a second at 64GiB. The 4GiB limit is related to the amount
> > of memory that may be addressed by a 32-bit physical address. To
> > access memory between the range of 1GiB and 4GiB, the kernel
> 
> 896 MB to 4GB actually...

896MB to available phy. memory.

> > This is what I have concluded 
> > 1. ZONE_NORMAL is from 16MB - 896MB.    ==> address space usable by
> > the kernel 
as I said address space usable by kernel ==> (3g to 4gb)


> 
>  Thats the physical memory, which is mapped from PAGE_OFFSET + 16MB.
> 
> > 2. High memory is from 1GB-4GB ==> to access this part of memory
> > kernel has to temporarily map pages from high memory into ZONE_NORMAL.
> > So, ZONE_HIGHMEM must be from 1GB-4GB and not from 896 MiB – End 
> 

its 896 - end of ram....so if u have 4gb ram it will be 869-4gb :)


> It is related in a way, if you have 2G/2G user/kernelspace split, then
> you can have more physical memory in ZONE_NORMAL, i.e it will be 2GB -
> 128MB if HIGHMEM enabled. This way the kernel is able to access more
> physical memory directly (since ZONE_NORMAL is mapped directly), than
> having to go through the overhead of kmap()/kmap_atomic().
> 
yes...but this reduces the size of the user space.

--
Vivek Kutal


--
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