Re : High and low mem

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

 



Hi

  No this still doesnt answer my question .... my doubt was

1) fine the amount of virtual space available to the kernel is 1 GB,
hence it can map a maximum of 1 GB physical mem to it .... but what about
user space processes , they have a virtual space of 3 GB( each one of
them), cant these user virtual addresses map to the upper 3GB physical
memory.

All the places where I see the RAM limitation discussion on older
kernels, the upper 3GB physical RAM(assuming the the processor is 32 bit and
there is 4GB of physical RAM too), is shown as UNUSBALE .. cant even
the user space processes map to this RAM ?

2) Also how does the highmem patch oercome this problem. The patch
introduces a highmem memory zone in the kernel virtual address space(128 MB
of the 1 GB virtual space available to the kernel). Now, we can map
physical memory greater than 1 GB to this area using kmap .... but again
this area is only 128 MB, hence how does it guarantee that we are able
to access all 4 GB of physical RAM ?

regards



pankaj chauhan <chauhan_ait@xxxxxxxxxxx> wrote:
hey,

wht my understanding about address space is :

Lets say u have a 32 bit machine, so ur total virtual
address space is 4GB, according to the configuration
this address space is partitioned as 3/1 (which is
more common) or 2/2, that is for 3/1 case lower 3Gb
addresses for User space addresses, and higher 1 Gb
addresses for kernel space, so the point that i make
here is that there is nothing like User space is "high
mem".

Concept of High mem:

Now we understand that in kernel space we have 1Gb
address space, so upto 896 Mb (u'll come to know it
later why it is 896 Mb not 1024 Mb) of physicalmem can
be directly mapped to these addresses. Problem arises
when ur machine has more than 896Mb of RAM, since u do
nt have addresees in kernel space to MAP the physical
mem permanently. The portion of Physical mem greater
than 896Mb is called High mem. To access high mem
kernel keeps a reserve of 128Mb (896 - 1024 Mb)
virtual addresses, which are used to map the high mem
ON DEMAND, that is when u need to access it use the
addresses frm the reserve and when u r done then free
those addresses. This is why limit for non high mem is
896 Mb not 1024 Mb , bcoz addresses in this range are
kept for accessing High mem.

Thanx
pankaj

--- Amit Singh wrote:
> Hi
>
> I had this doubt about high and low mem. I have
> read that for a 32 bit processor, generally the way
> linux divides virtual mem of 2^32=4GB, is that it
> simply keeps the higher 3GB as high mem and the
> lowest 1GB as low mem. Low mem generally being kept
> for the kernel and high mem for the user space. Now,
> there are kernel logical addresses, that have a one
> to one mapping to physical addresses .... also the
> kernel code and data structures like page tables
> also need to be kept in this 1GB, hence max mem that
> linux can deal with is <1GB.
> Kernel cannot deal with any address not mapped to
> its virtual address space(that is the lowest 1 GB on
> the system). So any address from high mem that needs
> to be handled by the kernel needs to be first mapped
> to kernel's virtual address space using kmap.
> 1) Does this mean that linux cannot wrk with system
> with a physical mem greater than 1 GB ?
> 2) what amount of this 1 GB is dedicated to logical
> addresses and what amount to kernel virtual
> addresses ?
> 3) Since the user space mem is always high mem, what
> happens when I do a int i; int *p=&i; *p++; in a
> user space program.
>
> thanks

Yahoo! India Matrimony: Find your life partner online.


[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