Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Recent bugfixes.



Den 2023-03-26 kl. 14:54, skrev Rhialto:
On Sun 26 Mar 2023 at 14:25:21 +0200, Anders Magnusson wrote:
Hi,

I have just checked in fixes for both the "S0 space > 1G" bug and the
CASMAGIC #define.
Have fun!
It still may make the page tables bigger than needed due to double
adding of several memory sizes. For example, in pmap.c, calc_kvmsize():

        /*
         * Compute the number of pages kmem_arena will have.
         */
        kmeminit_nkmempages();     // this calculates nkmempages
...
        /* kernel malloc arena */
        kvmsize += nkmempages * PAGE_SIZE;
... and then another time ...
        /* kernel malloc arena */
        kvmsize += avail_end;

What should be the size of the kernel malloc arena? Whatever is
calculated in kmeminit_nkmempages(), or just simply the physical memory size?
Likely not both added together.
So on smaller memory, it seems that some of it is wasted unnecessarily.
Please look at the patch:

 	kvmsize = calc_kvmsize(usrptsize);
+	/*
+	 * Ensure that not more than 1G is allocated, since that is 
+	 * max size of S0 space.
+	 * Also note that for full S0 space the SLR should be 0x200000,
+	 * since the comparison in the vax microcode is >= SLR.
+	 */
+#define	S0SPACE	(1*1024*1024*1024)
+	if (kvmsize > S0SPACE)
+		kvmsize = S0SPACE;
 	sysptsize = kvmsize >> VAX_PGSHIFT;
 	/*
 	 * Virtual_* and avail_* is used for mapping of system page table.

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.

-- Ragge


Home | Main Index | Thread Index | Old Index