Re: Jemalloc fallout on sandpoint

Rin Okuyama <[email protected]> Tue, 9 Apr 2019 17:41:54 +0900
Newsgroups gmane.os.netbsd.current,gmane.os.netbsd.ports.sandpoint
Message-ID <[email protected]>
On 2019/04/09 14:26, Julian Coleman wrote:
>> What kind of CPU is in this device?  It's possible that jemalloc is making a page size assumption that isn't true for this particular powerpc CPU (I think there were other issues like this on another port...)
>   
> It is:
> 
>    [   1.0000000] cpu0 at mainbus0: 8245 (Revision 0.4), ID 0 (primary)
>    [   1.0000000] cpu0: HID0 0x90c000<DOZE,DPM,ICE,DCE>, powersave: 1
>    [   1.0000000] cpu0: 265.31 MHz

sandpoint machines use PPC_OEA processors:
https://nxr.netbsd.org/xref/src/sys/arch/sandpoint/conf/std.sandpoint#8

PPC_OEA and PPC_BOOKE use 4K pages, whereas jemalloc on powerpc ports
is configured for LG_PAGE = MAX_PAGE_SHIFT = 14, i.e., 16K pages for
PPC_IBM4XX.

If it is the cause of the problem, fix is trivial for sandpoint, which
only uses PPC_OEA processors; just expose page size to userland.

However, it is not so easy for evbppc, where both PPC_OEA/BOOKE and
PPC_IBM4XX coexist. There is a similar problem for sparc, where both
4K and 8K pages are used.

Thanks,
rin