Re: Zone's in Linux



Alexander Krizhanovsky <a.krizhanovsky@xxxxxxxxx> wrote in
news:1187785854.294148.246500@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

As far as I understood this comment x86 can't directly address memory
higher than 896Mb (I don't understand why here is wrote 900Mb):
So could you explain why we have only 896Mb of Normal Zone (that is
can't directly address whole 2Gb of physical memory)? Why these 2Gb
aren't fully arranged to NormalZone?

The issue is how much of the memory is visible in kernel *virtual memory*
at a given time. There is a total visibility of 4GB of virtual memory.
In the "normal" x86 linux kernel configuration, the virtual address space
is subdivided between user-space which gets 3GB (address 0 through
0xbfffffff) and 1GB for the kernel address space (0xc0000000 through
0xffffffff). That is, the kernel only has 1GB of virtual memory space
available for its use. Starting at 0xc0000000, the first X pages of
physical memory are mapped 1-to-1 into kernel virtual memory space. This
makes it convenient to access any low physical address: you just add
PAGE_OFFSET (0xc0000000) to it.

However, if you have 2GB, it's clearly not possible to map 2GB of
physical pages into a 1GB virtual memory window. Also, certain other
physical memory areas (such as PCI devices' memory-mapped I/O areas) need
to be accessible in kernel virtual memory. To accommodate these
requirements, the standard configuration only maps the first 896 physical
pages 1-to-1 with kernel virtual memory space.

That leaves the last 128 MB (from 0xf8000000 to 0xffffffff) of virtual
address space available for other physical pages to be mapped into. Some
of this area gets used by drivers for various devices (such as the
aforementioned PCI devices) to make their memory-mapped I/O spaces
accessible via the ioremap* APIs. Finally, any other memory that needs
to be accessed by the kernel, must use temporary mappings in the
"highmem" area as provided by kmap/kunmap (specifically
kmap_high/kunmap_high).

The mappings of physical memory to virtual memory in the user-space area
(the low 3GB) will vary according to which process is currently running,
which of its code and data pages are currently present, and so forth.

There used to be a config option (CONFIG_X86_4G) which allocated the full
4GB of vm to user-space and a full 4GB of vm to the kernel with separate
page tables for each. But AFAICT this may have been a RedHat-specific
feature that is no longer supported.

GH
.



Relevant Pages

  • Re: Virtual Memory Advice for Vista 64 & 8GB of Ram
    ... "Dustin Harper" wrote: ... Virtual Memory which seems excessive, I can't help but wonder if it ... be better for me to set the VM myself instead of letting Windows handle ... Installed Physical Memory 8.00 GB ...
    (microsoft.public.windows.vista.performance_maintenance)
  • Re: Zones in Linux
    ... The issue is how much of the memory is visible in kernel *virtual memory* ... There is a total visibility of 4GB of virtual memory. ... physical memory are mapped 1-to-1 into kernel virtual memory space. ...
    (comp.os.linux.development.system)
  • Re: virtual memory
    ... In particular, you can have virtual memory without swap space, but not vice versa. ... etc.) but did support swapping. ... Perhaps it would be better to say that software transparent swapping requires virtual memory. ... This system gives software transparent swapping to each application, but only for a limited range of memory (since swapping it into physical memory is all or nothing). ...
    (comp.arch.embedded)
  • Re: Memory Limit
    ... DLLs are intentionally grouped towards the end of the 2GB ... Bo said that "I am not allocating physical memory, ... If I am using virtual memory and 3GB virtual memory dedicated to my single ...
    (microsoft.public.vc.language)
  • Re: Constant IE 6 Crashes After SP 2 Install
    ... > online spyware, virus & trojan scans. ... > Total Physical Memory 640.50 MB ... > Available Physical Memory 365.31 MB ... > Available Virtual Memory 1.96 GB ...
    (microsoft.public.windowsxp.help_and_support)