Re: more mm issues: logical versus virtual addresses

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

 



On 03-04-08 19:51, Robert P. J. Day wrote:

  given a typical 32-bit system, and the standard 3G/1G user/kernel
split of that 4G address space, that gives the kernel exactly 1G of
address space to work with, which is the set of virtual addresses at
0xC0000000 and up (that is, the interval [3G, 4G)).

  that entire address range are referred to as "virtual" addresses,
since they *all* have to be mapped in some way, but the addresses
above and below the HIGHMEM boundary are treated differently.

  generally, the virtual addresses in the interval [3G, 3G+896M) are
mapped to physical addresses simply by subtracting the offset of 3G,
so these are additionally referred to as "logical" addresses (in
hindsight, not a terrific choice of name but it seems to have caught
on).  that leaves the kernel address space of [3G+896, 4G) -- HIGHMEM
-- as the only way to refer to physical memory above 1G and,
obviously, for which extra address translation needs to be done.  so
far, so good?

As the only way to refer to physical memory above 896M, the part of memory called highmem. Highmem is not the [3G+896M,4G) range, that range is the vmalloc space and the window into which highmem pages are _mapped_.

Also, no extra address translations need to be done on highmem pages over lowmem pages, they just need to be mapped after which address translation is the same as for any other mapped page.

  so, some questions?

* if i absolutely *know* that i'm building a kernel for a system that
doesn't have more than 1G of RAM, do i need HIGHMEM at all?

s/1G/896M/ and no.

  i can, of course, deselect it during kernel configuration, but are there
any adverse effects to doing that other than making any RAM above 1G inaccessible?

No.

* since i can set the HIGHMEM boundary at boot time with "vmalloc=",
do i get the same effect with "vmalloc=0"?

No. VMALLOC_RESERVE is much like its name implies the amount of reseved addressspace for vmalloc (and ioremap, and some other) purposes. You need some of it to be able to use these interfaces -- to ioremap() hardware and to vmalloc() memory. Modules for example live in vmalloc() memory.

and, again, if i have <=1G of RAM, would it cause any problems?

Definitely.

* if i boot a regular kernel with HIGHMEM support on a system with
less than 1G, can i assume that no space at all will be allocated for
high memory since it would be totally pointless?

I don't think so in fact. I believe the normal set of reserved pageframes for highmem will still be reserved for highmem -- there aren't all that many of them though. 1024 normally, reserving 4M of addressspace inside that vmalloc range.

  thanks.  i have to explain all this stuff to some folks in a week or
so, so i figure i might as well understand it myself.  :-)

Important -- the defining difference between lowmem and highmem is that the first is permanently mapped into kernelspace whereas the second gets mapped and unmapped as needed and you only need it on 32-bit -- on 64-bit, you have enough addressspace to keep all your physical memory permanently mapped.

Also see if these old messages help:

http://mail.nl.linux.org/kernelnewbies/2005-11/msg00241.html
http://mail.nl.linux.org/kernelnewbies/2007-11/msg00269.html

Rene.

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