* allocate more than 2 GB on IA32
@ 2003-02-11 9:15 Hartmut Manz
2003-02-11 9:31 ` Gianni Tedesco
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Hartmut Manz @ 2003-02-11 9:15 UTC (permalink / raw)
To: linux-kernel
Hello,
i would like to allocate more than 2 GB of memory on an IA32 architecture.
The machine is a dual XEON_DP with 3 GB of Ram and 4 GB of swap space.
I have tried with the default SUSE 8.1 kernel as well as with a
2.4.20-pre4aa1 Kernel compile by my own using these Options:
CONFIG_HIGHMEM4G=y
CONFIG_HIGHMEM=y
CONFIG_1GB=y
but I am only able to allocate 2 GB with a single malloc call.
I tought it should be possible to allocate up to 2.9 GB of memory to a
process, with this kernel settings.
Thank You for any help
Hartmut Manz
--
-----------------------------------------------------------------------------
Hartmut Manz WWW: http://www.intes.de
INTES GmbH Phone: +49-711-78499-29
Schulze-Delitzsch-Str. 16 Fax: +49-711-78499-10
D-70565 Stuttgart E-mail: manz@intes.de
Ein Mensch sieht, was vor Augen ist; der Herr aber sieht das Herz an.
------------------------------------------------------- 1. Samuel 16, 7 -----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: allocate more than 2 GB on IA32
2003-02-11 9:15 allocate more than 2 GB on IA32 Hartmut Manz
@ 2003-02-11 9:31 ` Gianni Tedesco
2003-02-11 9:33 ` ÷ÉÔÁÌÉÊ
2003-02-11 16:11 ` Martin J. Bligh
2 siblings, 0 replies; 6+ messages in thread
From: Gianni Tedesco @ 2003-02-11 9:31 UTC (permalink / raw)
To: Hartmut Manz; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
On Tue, 2003-02-11 at 09:15, Hartmut Manz wrote:
> but I am only able to allocate 2 GB with a single malloc call.
> I tought it should be possible to allocate up to 2.9 GB of memory to a
> process, with this kernel settings.
have you tried your own anonymous mmap() with start set to getpagesize()
?
--
// Gianni Tedesco (gianni at scaramanga dot co dot uk)
lynx --source www.scaramanga.co.uk/gianni-at-ecsc.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: allocate more than 2 GB on IA32
2003-02-11 9:15 allocate more than 2 GB on IA32 Hartmut Manz
2003-02-11 9:31 ` Gianni Tedesco
@ 2003-02-11 9:33 ` ÷ÉÔÁÌÉÊ
2003-02-11 16:11 ` Martin J. Bligh
2 siblings, 0 replies; 6+ messages in thread
From: ÷ÉÔÁÌÉÊ @ 2003-02-11 9:33 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]
> I tought it should be possible to allocate up to 2.9 GB of memory to a
> process, with this kernel settings.
Obviously, No.
Unfortunatly kernel do not use segments (fully). So even you have HIMEM at the kernel it's not possible to user program to address more than 4 gb a ram at the same time. And as far as i know program can not have more than 1 gm of usable readwrite memory.
THe only way for u is to use 64 bit architecture... or remap default address range splitting increase address range for pgrogram data (it's require to recompile all programs).
Agri
On Tue, 11 Feb 2003 10:15:54 +0100
Hartmut Manz <manz@intes.de> wrote:
> Hello,
>
> i would like to allocate more than 2 GB of memory on an IA32 architecture.
>
> The machine is a dual XEON_DP with 3 GB of Ram and 4 GB of swap space.
>
> I have tried with the default SUSE 8.1 kernel as well as with a
> 2.4.20-pre4aa1 Kernel compile by my own using these Options:
>
> CONFIG_HIGHMEM4G=y
> CONFIG_HIGHMEM=y
> CONFIG_1GB=y
>
> but I am only able to allocate 2 GB with a single malloc call.
> I tought it should be possible to allocate up to 2.9 GB of memory to a
> process, with this kernel settings.
>
> Thank You for any help
>
> Hartmut Manz
>
> --
> -----------------------------------------------------------------------------
> Hartmut Manz WWW: http://www.intes.de
> INTES GmbH Phone: +49-711-78499-29
> Schulze-Delitzsch-Str. 16 Fax: +49-711-78499-10
> D-70565 Stuttgart E-mail: manz@intes.de
> Ein Mensch sieht, was vor Augen ist; der Herr aber sieht das Herz an.
> ------------------------------------------------------- 1. Samuel 16, 7 -----
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: allocate more than 2 GB on IA32
2003-02-11 9:15 allocate more than 2 GB on IA32 Hartmut Manz
2003-02-11 9:31 ` Gianni Tedesco
2003-02-11 9:33 ` ÷ÉÔÁÌÉÊ
@ 2003-02-11 16:11 ` Martin J. Bligh
2003-02-20 17:40 ` Hartmut Manz
2 siblings, 1 reply; 6+ messages in thread
From: Martin J. Bligh @ 2003-02-11 16:11 UTC (permalink / raw)
To: Hartmut Manz, linux-kernel
> i would like to allocate more than 2 GB of memory on an IA32 architecture.
>
> The machine is a dual XEON_DP with 3 GB of Ram and 4 GB of swap space.
>
> I have tried with the default SUSE 8.1 kernel as well as with a
> 2.4.20-pre4aa1 Kernel compile by my own using these Options:
>
> CONFIG_HIGHMEM4G=y
> CONFIG_HIGHMEM=y
> CONFIG_1GB=y
>
> but I am only able to allocate 2 GB with a single malloc call.
> I tought it should be possible to allocate up to 2.9 GB of memory to a
> process, with this kernel settings.
Well, assuming you had no user-space code or data, or a stack, or any
shared libraries to fit into that space as well ;-)
Try shifting TASK_UNMAPPED_BASE down from 1GB to 0.5GB - that should give
you some more breathing room, though you'll never get to 2.9GB.
M.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: allocate more than 2 GB on IA32
@ 2003-02-11 17:21 Manfred Spraul
0 siblings, 0 replies; 6+ messages in thread
From: Manfred Spraul @ 2003-02-11 17:21 UTC (permalink / raw)
To: Martin J. Bligh; +Cc: Hartmut Manz, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]
Martin wrote:
>> i would like to allocate more than 2 GB of memory on an IA32 architecture.
>>
>> The machine is a dual XEON_DP with 3 GB of Ram and 4 GB of swap space.
>>
>> I have tried with the default SUSE 8.1 kernel as well as with a
>> 2.4.20-pre4aa1 Kernel compile by my own using these Options:
>>
>> CONFIG_HIGHMEM4G=y
>> CONFIG_HIGHMEM=y
>> CONFIG_1GB=y
>>
>> but I am only able to allocate 2 GB with a single malloc call.
>> I tought it should be possible to allocate up to 2.9 GB of memory to a
>> process, with this kernel settings.
>
>Well, assuming you had no user-space code or data, or a stack, or any
>shared libraries to fit into that space as well ;-)
>
>
It's tricky, but not impossible.
Hartmut, start you application, allocate 2 gigabyte memory and then check
/proc/<pidof your app>/maps.
It shows how your virtual memory is used.
You application is loaded at address 0x08000000. The stack is at
0xbfffxxxx. Addresses above 0xC0000000 are reserved for the kernel.
Usually shared libraries are loaded at 0x40000000, and thus the largest
area is 2 GB: from 0x400xxxx to 0xbfffxxxx.
You must remove everything that is at 0x4000xxxx, then you can malloc
2.9 GB. Linking with --static is definitively required, but it's not
enough - the glibc-2.3 library startup seems to malloc something at
0x40000000. Try another C library.
One alternative would be a 2.9 GB global variable. An ugly example is
attached - I could create a 2943 MB large variable.
With some asm-foo, it should be possible to create one 2.9 GB variable.
Then implement your own malloc, backed by that 2.9 GB memory area.
--
Manfred
[-- Attachment #2: testmalloc.c --]
[-- Type: text/plain, Size: 622 bytes --]
#include <malloc.h>
// Test the maximum size of one linear block that is achievable with Linux
// compile with gcc --static.
#define SIZE 2943
unsigned char dummy1[1024UL*1024*SIZE/2];
unsigned char dummy2[1024UL*1024*SIZE/2];
int main(void)
{
if ((unsigned long)dummy2 != (unsigned long) ((&dummy1)+1)) {
printf("dummy1 has address %lx, ends at %lxh.\n",dummy1, (&dummy1)+1);
printf("dummy2 has address %lx.\n",dummy2);
printf("duh. something went wrong.\n");
} else {
printf("%d MB memory block starting at address %lxh available.\n",
SIZE, (unsigned long)dummy1);
}
for(;;) sleep(100);
return 0;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: allocate more than 2 GB on IA32
2003-02-11 16:11 ` Martin J. Bligh
@ 2003-02-20 17:40 ` Hartmut Manz
0 siblings, 0 replies; 6+ messages in thread
From: Hartmut Manz @ 2003-02-20 17:40 UTC (permalink / raw)
To: Martin J. Bligh, linux-kernel; +Cc: Manfred Spraul
On Tuesday 11 February 2003 17:11, Martin J. Bligh wrote:
> > i would like to allocate more than 2 GB of memory on an IA32
> > architecture.
> >
> > The machine is a dual XEON_DP with 3 GB of Ram and 4 GB of swap space.
> >
> > I have tried with the default SUSE 8.1 kernel as well as with a
> > 2.4.20-pre4aa1 Kernel compile by my own using these Options:
> >
> > CONFIG_HIGHMEM4G=y
> > CONFIG_HIGHMEM=y
> > CONFIG_1GB=y
> >
> > but I am only able to allocate 2 GB with a single malloc call.
> > I tought it should be possible to allocate up to 2.9 GB of memory to a
> > process, with this kernel settings.
>
> Well, assuming you had no user-space code or data, or a stack, or any
> shared libraries to fit into that space as well ;-)
>
> Try shifting TASK_UNMAPPED_BASE down from 1GB to 0.5GB - that should give
> you some more breathing room, though you'll never get to 2.9GB.
>
> M.
First of all I would like to say THANK YOU for your help.
I am now able to allocate up to ~3.2 GB of memory on a 4 GB Machine, even with
shared libraries.
This is what I have done.
1. I have activated the kernel option in Kernel 2.4.21pre4aa3
CONFIG_05GB=y
This gives the following:
a: TASK_UNMAPPED_BASE is now 0xe000000 wich is 224 MB
b: Upper Limit for User-Space memory is now at 3.5 GB
So I have the potential to allocated up to 3360 MB of memory
2. I have exchanged malloc with anonymous mmap, since malloc
was still only able to allocate about 2 GB.
--
-----------------------------------------------------------------------------
Hartmut Manz WWW: http://www.intes.de
INTES GmbH Phone: +49-711-78499-29
Schulze-Delitzsch-Str. 16 Fax: +49-711-78499-10
D-70565 Stuttgart E-mail: manz@intes.de
Ein Mensch sieht, was vor Augen ist; der Herr aber sieht das Herz an.
------------------------------------------------------- 1. Samuel 16, 7 -----
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-02-20 17:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-11 9:15 allocate more than 2 GB on IA32 Hartmut Manz
2003-02-11 9:31 ` Gianni Tedesco
2003-02-11 9:33 ` ÷ÉÔÁÌÉÊ
2003-02-11 16:11 ` Martin J. Bligh
2003-02-20 17:40 ` Hartmut Manz
-- strict thread matches above, loose matches on Subject: below --
2003-02-11 17:21 Manfred Spraul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox