On Sun 26 Mar 2023 at 16:28:52 +0200, Anders Magnusson wrote:
Please look at the patch:
[ correctly limits the total size ]
After everything is calculated I check if kvmsize gets larger than 1G, and
in that case truncates it to 1G.
I haven't changed the calculations.
But that's my point. For smaller memory sizes, it likely calculates a
bigger page table size than needed (by counting things double) (and thus
wastes memory on the page table).
That is of course a different bug, but now that we're looking at
this area of code we might well think about how it should be.