lkml.org 
[lkml]   [1998]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Problem with 1G RAM
On Fri, 4 Dec 1998, Neil Conway wrote:

> OK, who wants to volunteer to insert a check in the kernel: STOP if
> __PAGE_OFFSET is incompatible with the amount of RAM specified by
> "mem=xxxM" ? Failing that, print a warning, and reduce the RAM to
> (say) 960MB or whatever.

mirkwood:~/linux/arch/i386/kernel# grep MAXMEM *
setup.c:#define MAXMEM ((unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE))
setup.c: if (memory_end > MAXMEM)
setup.c: memory_end = MAXMEM;
mirkwood:~/linux/arch/i386/kernel#

It looks to me that there already is code like this inside
kernel 2.1.131. Question is why it doesn't work correctly.

Let's see what happens:

MAXMEM = -0xC0000000-(64<<20)

The only reason this could go wrong is when something fouls
up with the conversion from a signed to an unsigned number.

In that case:

#define MAXMEM (MAX_INT - PAGE_OFFSET - VMALLOC_RESERVE + 1)

then again, I may have overlooked something silly :)

cheers,

Rik -- the flu hits, the flu hits, the flu hits -- MORE
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.100 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site