On Thu 23 Mar 2023 at 11:38:25 +1100, Kalvis Duckmanton wrote:
> On 22/3/23 23:40, Mouse wrote:
> > That's odd. Maybe it's reserving enough space for _two_ copies of
> > physical memory or something?
>
> I think that's exactly what's happening - vax/pmap.c:calc_kvmsize() starts
> like this:
>
> static vsize_t
> calc_kvmsize(vsize_t usrptsize)
> {
> vsize_t kvmsize, bufsz;
>
> /*
> * Compute the number of pages kmem_arena will have.
> */
> kmeminit_nkmempages();
>
> /* All physical memory */
> kvmsize = avail_end;
> /* User Page table area. This may be large */
> kvmsize += (usrptsize * sizeof(struct pte));
> /* Kernel stacks per process */
> kvmsize += (USPACE * maxproc);
> /* kernel malloc arena */
> kvmsize += nkmempages * PAGE_SIZE;
> /* IO device register space */
> kvmsize += (IOSPSZ * VAX_NBPG);
> /* Pager allocations */
> kvmsize += (pager_map_size + MAXBSIZE);
> /* Anon pool structures */
> kvmsize += (physmem * sizeof(struct vm_anon));
> /* kernel malloc arena */
> kvmsize += avail_end;
>
> avail_end is the size of physical memory. Note that it's being added to
> kvmsize twice; the returned kvmsize is then used to calculate the length of
> the system page table.
Thinking about why it is like that, and not simply an overlooked
duplication, I see "All physical memory" plus "kernel malloc arena"...
ok, sounds reasonable, somewhat.
But there are also two "kernel malloc arena"s:
> /* kernel malloc arena */
> kvmsize += nkmempages * PAGE_SIZE;
> /* kernel malloc arena */
> kvmsize += avail_end;
which brings back the sneaky doubt that there is a bit too much added
here that could be reduced.
-Olaf.
--
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/ have kids to make his activity cost neutral." -The BOFH falu.nl@rhialto
Attachment:
signature.asc
Description: PGP signature