Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2023 02:31:34 +0200
From:      Robert Clausecker <fuz@freebsd.org>
To:        ports@freebsd.org
Subject:   Avoiding OOM for armv7 ports on arm64
Message-ID:  <ZThh5ldz7jyeH3N6@fuz.su>

next in thread | raw e-mail | index | archive | help

--KsGSWqEapCkRvaqJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Greetings,

One thing that bugged me for quite a while is that armv7 tasks on arm64
hosts (common case for cross-building ports) can seemingly only allocate
2 GB of memory despite having access to a full 32 bit virtual address
space, which should give 4 GB of memory to play around with.

This causes many ports to fail due to address space exhaustion in LLVM
and rustc.

Debugging this with kib, we found that poor default and lack of kernel
code are to blame (PR #274705).  A workaround can be applied to select
roughly the same defaults as used for i386 tasks on amd64:

To /etc/sysctl.conf, add

    kern.maxssiz=3D67108864
    kern.maxdsiz=3D536870912

to restrict the stack reservation to 64M.  This also affects 64 bit
processes, but I don't think anybody needs more stack than that.
Data is restricted to 512M, which doesn't really matter for 64 bit
as we do not support sbrk on arm64.

Then reboot, or apply these limits with the sysctl utility.

Hope this helps!

Yours,
Robert Clausecker

--=20
()  ascii ribbon campaign - for an 8-bit clean world=20
/\  - against html email  - against proprietary attachments

--KsGSWqEapCkRvaqJ
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKTBAABCgB9FiEExWcBrcoFY7LMaPxvWXxDScqS3gUFAmU4YeNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1
NjcwMUFEQ0EwNTYzQjJDQzY4RkM2RjU5N0M0MzQ5Q0E5MkRFMDUACgkQWXxDScqS
3gWueBAAu3IiB0PBA6vkLbPXZJ1rOIsqmnuyBR3ErDAfAAdIYJ2a4FkldSf05xF3
NiwiICymhZsLJLi5+o6WGgGNIFbJNaE9IDCaTcBq0rF1axya0WOhMDkMaTT3QnK/
AKz4/aDs9OzWPASiR55SpyJIAscT73u26HxEm/A+Ix5JzuMH5S9xrK1AU+zhOWxA
i+7FVUrW0dZEpLA3Ht8bds7ZCXrnEmj0cxMNMyfG13+mQsGIy0G70wugPZ6PsK5l
3vWBiagUKpT8cRVA/8F7+AlAUdK4alceFRfZ0sJwjd8DJJ6UOV05Bw9Xm1L1XqCq
N8TBby+L4gIotwqxDrBr/OpGPKawGjneDVUTpb6QHPBYB9YJucOGVBY13czQ84Dn
a06vkT19fXKXVVSOqXZsT5XzS0PIV4dcaXyS/S/3X6DHupSDg2Dw0UhmKCHmKzIF
XuWV+8t3+tCtKJTHTDE3Fg0eoIL5vFu5ABrvbTiz+dWkUSw5GekOJytWpOSlfVfv
GAWBD9m24c5C3o3/Hsx1vSQY5GR/H5Q1A7m/mEnhOiqGinTIMAsqdWaldNhnnpOV
+6vjoRMmr2T2TkaWqrcz2G0xA5idFcnjFmvdUlXMiykLfh6+xaQZzww9xWG8Jhlp
aA1py1jROrpGH5g8VVi8lJFA5dKaQOgRSzpctURyvzU+kHLJScA=
=pQbU
-----END PGP SIGNATURE-----

--KsGSWqEapCkRvaqJ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZThh5ldz7jyeH3N6>