On Sun, Dec 04, 2016 at 05:20:09PM +0100, Guillem Jover wrote:
> On Sun, 2016-12-04 at 16:07:16 +0200, Adrian Bunk wrote:
>...
> > I don't know how much RAM the amd64/i386 buildds have,
> > but I'd guess more than 4 GB...
> >
> > A hard upper limit somewhere around 1.5 GB on all 32 bit architectures
> > (or on all architectures, if that's easier to implement) is required.
>
> The patch now clamps the physical memory to INTPTR_MAX. So that we both
> do not exceed the physical memory available nor the addressable limit.
>
> But I should indeed probably also subtract some space for the rest of
> the userland that might be running. I'll do that later today.
>...
It is a bit more complicated.
Clamping to something like 80% of INTPTR_MAX might be good enough
for practical purposes, but technically this limit is not related
to INTPTR_MAX.
Addressable are actually 4 GB.
The problem is that these 4 GB are split between user memory and
kernel lowmem.
On several architectures (e.g. i386, ARM) it is actually a configure
option of the kernel whether you want 1 GB, 2 GB or 3 GB of user memory
(with accordingly less kernel lowmem).
< 2 GB user memory is unlikely to be a configuration you will see
in practice (especially not on the buildds), so staying some margin
below 2 GB on 32 bit (e.g. 80% of INTPTR_MAX) should work fine in
practice.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed