NetBSD-Bugs archive

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

port-sparc/60971: Severe KVA starvation with 512MB physical memory



>Number:         60971
>Category:       port-sparc
>Synopsis:       Severe KVA starvation with 512MB physical memory
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 06 11:00:00 +0000 2026
>Originator:     Rin Okuyama
>Release:        11.99.9
>Organization:
Internet Initiative Japan Inc.
>Environment:
NetBSD ss10 11.99.9 NetBSD 11.99.9 (SS10) #28: Sun Nov  1 10:39:39 JST 2026  rin@sakaizumii.local:/home/rin/src/sys/arch/sparc/compile/SS10 sparc sparc
>Description:
On my SS10 with 512MB memory, system can be easily unresponsive
when running ATF or building pkgsrc. When this happens, I can
only enter DDB from console. Then, I observe some processes
stall indefinitely at uarea or vm_map.

This should be ascribable to KVA starvation; even though system
has 512MB physical memory, there is only 224MB of KVA space
(0xf0000000 to 0xfe000000). So, KVA is easily exhausted by buffer
cache and etc..

As a PoC, I tried to extend KVA to ~ 2GB: 0x80000000 to 0xfe000000.
Then, system becomes very stable; it survives full ATF run, and
can build many pkgsrc's without problems as far as I can see.

The patch I used is provided here:

https://www.netbsd.org/~rin/sparc-extend-kva-20261106-1.patch

In this patch:

(1) EKVA{,.MP} kernels are introduced for sun4m and sun4d, where
    VM_MIN_KERNEL_ADDRESS is changed to 0x80000000. Bottom of
    kernel text VA is also changed to 0x80004000. (Probably,
    224MB of KVA space is enough for sun4/sun4c machines, IIUC.)

(2) For boot loader, let PROM map 2.25MB, instead of 0.5MB, of
    memory in additional to kernel image for sun4m/sun4d. This is
    necessary to construct kernel page table for ~ 2GB KVA space.

Even though EKVA kernel works just fine for me, there remain
concerns for me:

(a) This requires specific kernels other than GENERIC{,.MP}.

(b) Boot loader maps more memory for sun4m/sun4d. This should be
    not a big problem for usual sun4m/sun4d machines. However,
    IIUC, some models of JavaStation was shipped with only 8MB
    memory.

(c) User VA space is restricted to 2GB on EKVA{,.MP} kernels.
    However, even NetBSD/armv7 has also 2GB UVA space.

Thoughts? Are there more acceptable solutions?
>How-To-Repeat:
Described above.
>Fix:
PoC provided above.




Home | Main Index | Thread Index | Old Index