Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Apr 2021 08:17:48 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        KIRIYAMA Kazuhiko <kiri@truefc.org>
Cc:        Steve O'Hara-Smith <steve@sohara.org>, freebsd-arm@freebsd.org
Subject:   Re: How to build packages on PBP ?
Message-ID:  <8A9FBA4D-9BBD-4D67-ACE1-29F2BF91592F@yahoo.com>
In-Reply-To: <202104241033.13OAXdDH085225@kx.truefc.org>
References:  <202104220108.13M18dvG021683@kx.truefc.org> <20210422070556.b02b17d7ba2c133af028149e@sohara.org> <202104241033.13OAXdDH085225@kx.truefc.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-Apr-24, at 03:33, KIRIYAMA Kazuhiko <kiri at truefc.org> wrote:

> On Thu, 22 Apr 2021 15:05:56 +0900,
> Steve O'Hara-Smith wrote:
>>=20
>> On Thu, 22 Apr 2021 10:08:39 +0900
>> KIRIYAMA Kazuhiko <kiri@truefc.org> wrote:
>>=20
>>> I'm tring to build packages for my desktop use on pineboookpro =
(PBP),
>>> but suddenly crashed during compiled devel/llvm10 and failed to =
build
>>> llvm10-10.0.1_5.txz. The reason why I guess was for too heavy to =
process
>>> to compile llvm10 because it's load average was over 6.0 !
>>=20
>> 	It probably ran out of memory, try setting NO_PARALLEL=3D1 in =
the
>> environment and/or add some swap and try again.
>=20
> Unfortunately also crashed with:
>=20
> root@kazu:/var/ports/lpbpkx/devel/llvm90 # env NO_PARALLEL=3D1 make =
package-recursive
>=20
> Swap is ready by 8GB:
>=20
> root@kazu:~ # swapinfo -h
> Device              Size     Used    Avail Capacity
> /dev/mmcsd0p2       8.0G       0B     8.0G     0%
> root@kazu:~ #=20
>=20
> The situation before crash is like [1].
>=20
> [1] http://www.truefc.org/~kiri/freebsd/pbp/IMG_1417.jpeg
>=20

I recommend trying the following in, say, /boot/loader.conf=20
and booting with the settings before attempting another
build:

#
# Delay when persistent low free RAM leads to
# Out Of Memory killing of processes:
vm.pageout_oom_seq=3D120
#
# For plunty of swap/paging space (will not
# run out), avoid pageout delays leading to
# Out Of Memory killing of processes:
vm.pfault_oom_attempts=3D-1
#
# For possibly insufficient swap/paging space
# (might run out), increase the pageout delay
# that leads to Out Of Memory killing of
# processes (showing defaults at the time):
#vm.pfault_oom_attempts=3D 3
#vm.pfault_oom_wait=3D 10
# (The multiplication is the total but there
# are other potential tradoffs in the factors
# multiplied, even for nearly the same total.)

Notes:

While I've never done anything that required it,
vm.pageout_oom_seq could be set even bigger.
Someone once reported using a figure like 1200
instead. No setting gives an unbounded delay.

If you decide to not use vm.pfault_oom_attempts=3D-1 :

For that last you would want to increase one or both
of: vm.pfault_oom_attempts and/or vm.pfault_oom_wait
instead of using 3 and 10 as the values.

If you do got (or get) one or more "was killed: out of swap
space" messages on the console: Be warned that the "out of
swap space" part can be a misnomer. Only if you also see
message(s) with text of the form
"swap_pager_getswapspace(...): failed" is the swap space
part of the notice the actual cause as far as I know. Other
causes include:

Sustained low free RAM (via stays-runnable processes).
A sufficiently delayed pageout.
The swap blk uma zone was exhausted.
The swap pctrie uma zone was exhausted.

The earlier tuning attempts to deal with the first two of
those, not the last two.

The 2 or 3 tunables above can instead be placed in
/etc/sysctl.conf if desired.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8A9FBA4D-9BBD-4D67-ACE1-29F2BF91592F>