On Wed, Jun 16, 2004 at 06:48:48AM +0300, Shachar Shemesh wrote:
> Muli Ben-Yehuda wrote:
> 
> >On Tue, Jun 15, 2004 at 11:19:42PM +0300, Shachar Shemesh wrote:
> > 
> >
> >>If choosing "off" gives each process a 3GB usable address space, why 
> >>should I want to turn it on if my machine only has 2GB?
> >>   
> >>
> >
> >Because Linux only direclty maps the first 896mb of physical
> >memory. If your machine has 2GB of phys. memory, and you choose
> >"off", your kernel will only recognize the first 896mb of memory. The
> >documentatino text leaves something to be desired... 
> > 
> >
> I'll say. I still didn't understand it, though.
> 
> > 
> >
> >>If I understand correctly, running in 4GB mode means that I need to 
> >>remap the kernel space every time I enter kernel context, which imposes 
> >>some performance penalty. 
> >>   
> >>
> >
> >That's 4:4, which is something different. It is used when you need 4gb
> >of address space for either the kernel or userspace (or both). 
> > 
> >
> Is it one of the options in himem support? I have there "off", "4GB", 
> and "64GB".
> 

That would be the 4GB option. It is used when you want 4 GB of memory
for the machine.

> >>One should think I would like to avoid it if 
> >>it's not necessary.This means that only going above 3GB would cause me 
> >>to want to turn this on, and even then, only if I have a single app that 
> >>needs more than 3GB of memory.
> >>
> >>Am I wrong here? Is this a bug in the documentation?
> >>   
> >>
> >
> >You're mixing virtual memory (the available address space) and Linux's
> >physical memory handling. To recap, only the first 896mb is directly
> >mapped by the kernel, and for the rest (anything up to 4GB of physical
> >memory) you need "highmem support". Then the kernel will use the
> >physical memory between 896mb-4gb by mapping it "on the fly" whenever
> >it needs to be used. This does incur some run time overhead, but only
> >for the memory between 896mb-4gb (ZONE_HIGHMEM), which will not be
> >used at all otherwise... 
> > 
> >
> You lost me totally.
> 
> Let's see what I understand. I get 3GB of virtual memory, no matter what 
> I compile in. If I want 4, I need a "4:4" patch, which is presumably not 
> there by default.

Its the 4GB himem option.

> If I compiled himem support to "off", I get just 1GB (well, less) of 
> physical memory easily accessed. What's the difference? If I have a 

You get just 896M of memory accessible, if you have more memory in the
machine it just won't be used. It will just lye there basking in the
heat of the cpu, but won't be doing much else.

There was just a thread about this in kernel newbies, but I don't
remember the exact details. IIRC the kernel address the first 896M of
memory directly, not as virtual memory (or maps the top 896M of virtual
memory to consecutive real address, not sure about that point, this
would result in simple (pointer - offset) to calculate real
address). User space get real virtual addresses, i.e a pointer in
userspace can point into the swap. There is no direct corelation
between user space pointers and physical addresses.

> machine with 4GB of physical memory, and himem support compiled "off", 
> and I ask for 2.5GB of heap memory, what is going to happen? Do I get 
> failure? Do I swap? Is the memory going to be used, but with some 
> performance penalty per context-switch?

896M will be taken of the physical memory (or actually what is free of
it) and the rest should be of the swap, assuming you have enough
available. the 3+GB above the 896M won't be used.

I am not sure though how the swap fits into the whole memory
scheme. Will be happy for some clarification there. Is it possible to
have 500M ram + 3 GB swap with no himem? (Ignoring the overhead of 3G
swap and other large swap related issues for the moment). I assume yes,
but like I said, where does it fit into the virtual memory issue.

> 
> >Cheers, 
> >Muli 
> > 
> >
> Even more confused than before,
> 
>             Shachar
> 
> -- 
> Shachar Shemesh
> Lingnu Open Source Consulting ltd.
> http://www.lingnu.com/
> 
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 
> 
> +++++++++++++++++++++++++++++++++++++++++++
> This Mail Was Scanned By Mail-seCure System
> at the Tel-Aviv University CC.
> 

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to