Re: bcm283x_dwcotg0: usbpf: Out of memory

bob prohaska <[email protected]> Thu, 16 Apr 2026 11:27:32 -0700
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
On Thu, Apr 16, 2026 at 10:45:06AM -0700, Mark Millard wrote:
> On 4/16/26 08:15, void wrote:
> > just to update, I had to quickly add more swap,
> > otherwise buildworld crashes. It seems more swap is needed
> > the more N in make -jN buildworld is used.
> > 
> > For the time being I quickly made three 3gb swap partitions
> > on a usb2 stick and removed the default growfs swapfile
> > and now make -j3 buildworld is proceeding, if slowly.
> > 
> > I've not tested yet whether writing to the stick is
> > faster than writing to nfs. if not, there's always the option
> > of mounting swap over nfs.
> 
> You are likely getting console messages like (lines wrapped differently
> here):
> 
> warning: total configured swap (??? pages) exceeds maximum recommended
> amount (??? pages).
> warning: increase kern.maxswzone or reduce amount of swap.
> 
> Indicating potential mis-tunning that can result in deadlocks being more
> likely from kernel memory management, if I understand right. Also, as I
> understand, actually increasing kern.maxswzone trades off the amounts of
> other types of kernel(?) memory available. (Not that I know the detailed
> tradeoffs.)
> 
> A RPi2B has 1 GiByte of RAM. As I remember, armv7 (so: 32-bit) starts
> putting out that notice-pair at somewhat under 2 GiBytes of swap space
> (somewhere between 1.7 GiBytes and 2.0 GiBytes?). (64-bit has a much
> larger ratio before getting such notices, as I remember.)
> 
> If Bob is still using large swap spaces, there is some possibility that
> such has contributed to running out of memory, not that I know how to
> validate such happened.
> 

It turns out a 1.8GB swap partition does not provoke the "excess 
swap" warning and seems sufficient for a -j3 buildworld to proceed.
-j4 works usually, but if Clang is fully rebuilt in -j4 the machine
_can_ run out of swap and kill processes.  

Using swap on microSD or USB flash led (I think) to subtle binary
corruption that you helped me sort out. Since then I've used only
mechanical hard disks for swap and have not seen any obvious repeats.

Thanks for writing,

bob prohaska