On Fri, Apr 10, 2020 at 10:25:14AM -0400, Nick Holland wrote:
> On 2020-04-10 10:10, Stefan Sperling wrote:
> > On Fri, Apr 10, 2020 at 09:35:16AM -0400, Nick Holland wrote:
> > FWIW, my soekris net5501 with 256MB of RAM and 512MB swap does manage
> > to relink a kernel (on 6.6 + syspatches).
> 
> Whoops.  Guess I should have mentioned, that was -current, as of
> yesterday 
> OpenBSD 6.7-beta (GENERIC.MP) #110: Thu Apr  9 01:20:52 MDT 2020
>     dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
> real mem  = 334970880 (319MB)
> avail mem = 313077760 (298MB)
> 
> and probably a couple weeks ago for the real (old) hw.
> 
> I'm curious if your Soekris can handle 6.7-beta.
> 
> Nick.

It's been fixed in 6.7 release!

This was indeed a problem on my alix and soekris machines for a while.
And I could also reproduce it in a 6.7-beta low memory VM as you did.

I attempted to debug ld.lld for a while but eventually gave up (debugging
the linker is quite painful).

I did not come to any conclusion but did notice that ld.lld uses mmap to 
write ELF data to the output file. That file always ended up being corrupt
under low memory conditions. The old ld.bfd linker uses stdio and worked OK.

With 6.7 kernel relinking with little amounts of memory suddenly started
working again. To make sure I'm not dreaming I bisected the commit which
fixed it.

Turns out this problem was fixed by beck@ in the commit below.
I can even relink kernels on i386 in 64MB of RAM now. Didn't test lower
than that.  Case closed. Just upgrade to 6.7 and it'll be fine :-)

CVSROOT:        /cvs
Module name:    src
Changes by:     b...@cvs.openbsd.org    2020/04/28 20:25:48

Modified files:
        sys/kern       : vfs_bio.c 

Log message:
Ensure that if we are doing a delayed write with a NOCACHE buffer, we
clear the NOCACHE flag, since if we are doing a delayed write the buffer
must be cached or it is thrown away when the "write" is done.
fixes vnd on mfs regress tests.

ok kettenis@ deraadt@

Reply via email to