From owner-freebsd-stable@freebsd.org Fri Jun 26 15:13:47 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E07F35A303 for ; Fri, 26 Jun 2020 15:13:47 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from gromit.dlib.vt.edu (gromit.dlib.vt.edu [128.173.49.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "gromit.dlib.vt.edu", Issuer "Chumby Certificate Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49tgQ227y5z4kQv; Fri, 26 Jun 2020 15:13:46 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from mather.gromit23.net (c-98-244-101-97.hsd1.va.comcast.net [98.244.101.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gromit.dlib.vt.edu (Postfix) with ESMTPSA id 3461B173; Fri, 26 Jun 2020 11:13:45 -0400 (EDT) From: Paul Mather Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: swap space issues Date: Fri, 26 Jun 2020 11:13:44 -0400 In-Reply-To: <52753cf4-57db-93d9-d217-c8f812d6bc7c@freebsd.org> Cc: freebsd-stable , Peter Jeremy To: =?utf-8?Q?Stefan_E=C3=9Fer?= References: <20200625000410.GA10210@eureka.lemis.com> <20200625025248.GB10210@eureka.lemis.com> <20200626102331.GA6406@server.rulingia.com> <52753cf4-57db-93d9-d217-c8f812d6bc7c@freebsd.org> X-Mailer: Apple Mail (2.3445.104.14) X-Rspamd-Queue-Id: 49tgQ227y5z4kQv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=vt.edu (policy=none); spf=none (mx1.freebsd.org: domain of paul@gromit.dlib.vt.edu has no SPF policy when checking 128.173.49.70) smtp.mailfrom=paul@gromit.dlib.vt.edu X-Spamd-Result: default: False [-0.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.78)[-0.783]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; NEURAL_SPAM_SHORT(0.40)[0.402]; NEURAL_HAM_MEDIUM(-0.21)[-0.206]; RECEIVED_SPAMHAUS_PBL(0.00)[98.244.101.97:received]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:1312, ipnet:128.173.0.0/16, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[vt.edu : No valid SPF, No valid DKIM,none] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 15:13:47 -0000 On Jun 26, 2020, at 6:58 AM, Stefan E=C3=9Fer wrote: > Am 26.06.20 um 12:23 schrieb Peter Jeremy: >> On 2020-Jun-25 11:30:31 -0700, Donald Wilde = wrote: >>> Here's 'pstat -s' on the i3 (which registers as cpu HAMMER): >>>=20 >>> Device 1K-blocks Used Avail Capacity >>> /dev/ada0s1b 33554432 0 33554432 0% >>> /dev/ada0s1d 33554432 0 33554432 0% >>> Total 67108864 0 67108864 0% >>=20 >> I strongly suggest you don't have more than one swap device on = spinning >> rust - the VM system will stripe I/O across the available devices and >> that will give particularly poor results when it has to seek between = the >> partitions. >=20 [[...]] >> As a further piece of arcana, vm.pageout_oom_seq is a count that = controls >> the number of passes before the pageout daemon gives up and starts = killing >> processes when it can't free up enough RAM. "out of swap space" = messages >> generally mean that this number is too low, rather than there being a >> shortage of swap - particularly if your swap device is rather slow. >=20 > I'm not sure that this specific sysctl is documented in such a way > that it is easy to find by people suffering from out-of-memory kills. >=20 > Perhaps it could be mentioned as a parameter that may need tuning in > the OOM message? >=20 > And while it does not come up that often in the mail list, it might > be better for many kinds of application if the default was increased > (a longer wait for resources might be more acceptable than the loss > of all results of a long running computation). The OOM issue is more pressing on platforms like FreeBSD/arm that tend = to have low RAM and slow writable storage such as SD card. There have = been several threads on the issues this creates (e.g., = https://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D228789+0+archive/2018/free= bsd-arm/20180819.freebsd-arm = ) that have led to some insight into how = to tune the OOM killer. One thing that becomes clear is that the "Out = of swap space" error message is misleading as often it really means = "Couldn't obtain RAM in a timely fashion." On hardware such as the = Raspberry Pi, it's often the case that the system has enough swap space: = it's just that it can't write to swap on SD card before the default = vm.pageout_oom_seq passes are exhausted and so the OOM killer starts = reaping active processes (like the clang trying to build clang:), and = all sorts of things start to break. :-) Cheers, Paul.=