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

Re: EnableHiMem for Memory == exactly 1GB?



On Wed, Jun 30, 2004 at 04:53:51PM +1000, Rob Weir wrote:
> On Tue, Jun 29, 2004 at 11:25:03PM -0700, William Ballard said
> > Greg Madden in <[🔎] 200406261122.05053.gomadtroll@gci.net>, suggested 
> > enabling CONFIG_HIGHMEM4G=y for machines with > 960MB memory; however 
> > the help for this option in 2.6.7 says "if you will never run a machine 
> > with more than 1 Gigabyte of memory."
> > 
> > It seems to suggest that for the interval [0,1024] it should be not set 
> > and (1024,4096] it should be set; i.e. not set at exactly 1GB.  Is this 
> > correct?
> 
> I'm pretty sure the limit is at 896MB of RAM.  Without HIGHMEM, the
> kernel will ignore all memory above that.  With it, the kernel will use
> up to $bignum GB of RAM, but (some? all? I forget) memory access will be
> slower.  The conventional wisdom seems to be that if you have less than
> 1GB of RAM, then this slowdown negates the benefit of the extra =< 128
> MB of RAM you would have access to.  Or so I've heard; my biggest
> machine has 512MB of RAM.  It's probably one of those things where you
> need to test it yourself to decide whether it's worth it for you or not.
> 

There are two levels of highmem. One up to 4GB and one above that (for
32 bit machines that is). The difference is due to 32bit pointers
limited to 4GB.

The difference is that without himem the kernel maps the physical memory
to the top 1GB permanently so that it won't have to remap the memory on
context switches to kernel space. With 4GB himem the kernel and
user-space have different memory spaces which require remapping the
virtual memory on context switch.

With more the 4GB the kernel has to map physical memory to a virtual
address each time it has to be accessed, (something like the memory handles
in windows 3). Not sure how user-space accesses more then 4GB in this
case.

For 1-2 GB machines there is also a patch that gives you a 2GB-2GB
memory split which allows you to use up to two GB without highmem (not
sure where the exact limit is). The upside is no memory remapping on
context switch, the downside is that programs are limited to 2GB
instead of 3GB (take into account here also the swap not only physical
memory).

This is not an exhaustive description but is the general idea (I never
can remember the full details here, memory overflow ;-)

> -- 
> Words of the day:  CDMA Firewalls quarter AK-47 bullion unclassified War Crimes



Reply to: