From owner-freebsd-questions@freebsd.org Tue Feb 11 16:21:59 2020 Return-Path: Delivered-To: freebsd-questions@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 D039E23A9CE for ; Tue, 11 Feb 2020 16:21:59 +0000 (UTC) (envelope-from tech-lists@zyxst.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48H7MW0s4Nz4D86 for ; Tue, 11 Feb 2020 16:21:58 +0000 (UTC) (envelope-from tech-lists@zyxst.net) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B272D20E15 for ; Tue, 11 Feb 2020 11:21:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 11 Feb 2020 11:21:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zyxst.net; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=r2vzNo0LGVkE4OUIMAFSLYd29Mg +UXlAZFevnnHp1uI=; b=S0VLUp/4oU2M/RoUm9TefvB2WezV/pVRdCoqiU4fMUu DvaPjX2udT+Ic8jGQlNcogQatPdm94w+nP0xFB0pnfEFxL24NVZqyZBYJeTxEPKS ksIUdpZS7FObcyZUa0ugW4XLt9EueuWdJxQfxBjlfswUAUtD5K/nyw+8ob52GE1A aBAhNGbj/7e+2sKuyRxywsriPmgaXCEXeCTwLM+S/4nKr99G7OQJ0VhPBHejf6F+ df5Q5K4/TQQFUqw3pbNc0YJsEAjZrssEOS+Jl1oCKnDEHUVcVbJ49fA8o/ZXe5pe fy8ebSNB8NiJuANdtO+FHKnYFduP7Qayxyr2a2z+3pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=r2vzNo 0LGVkE4OUIMAFSLYd29Mg+UXlAZFevnnHp1uI=; b=j3jegmZ+p+j1PFmGr9C0QX FrlrewtdpXYMFlZ8rgy3UoOpN9+Chjyx/QHuHDN/7tTF2kPBScW2CNIP9GDw9Evy CtrAldTYf2rwCo3uh6lFlmw7bS2knuyOE25pqz25uZnPHm2t6CzkqcDHVhRQfyKZ RKFDgMjvtORWmTDI/ink9DKoa6xmYh/nkCxT+kurOXrghSEquP5wZZBttx+uaLh2 iHMq/W7sJz+vISn0j0Qe+5QIiwtY4j1pNOQia4ugYIXFeEhkkKk2DasFog+exOk8 g8pkPmtzcWT19+qwLb5C0dMDtgEHW/QrJbksgnr4ivmoabdF8GU+1BBg+pNqaQHQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieefgdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehgtderre dttddvnecuhfhrohhmpehtvggthhdqlhhishhtshcuoehtvggthhdqlhhishhtshesiiih gihsthdrnhgvtheqnecukfhppeekvddrjedtrdeluddrleelnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthgvtghhqdhlihhsthhsseiihiig shhtrdhnvght X-ME-Proxy: Received: from bastion.zyxst.net (bastion.zyxst.net [82.70.91.99]) by mail.messagingengine.com (Postfix) with ESMTPA id 0798430600DC for ; Tue, 11 Feb 2020 11:21:57 -0500 (EST) Date: Tue, 11 Feb 2020 16:21:29 +0000 From: tech-lists To: freebsd-questions@freebsd.org Subject: Re: questions about swap (partition and file) Message-ID: <20200211162129.GC9715@bastion.zyxst.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <20200211155009.GA9715@bastion.zyxst.net> <20200211165552.e122bf2c.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <20200211165552.e122bf2c.freebsd@edvax.de> X-Rspamd-Queue-Id: 48H7MW0s4Nz4D86 X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=zyxst.net header.s=fm1 header.b=S0VLUp/4; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=j3jegmZ+; dmarc=none; spf=pass (mx1.freebsd.org: domain of tech-lists@zyxst.net designates 66.111.4.25 as permitted sender) smtp.mailfrom=tech-lists@zyxst.net X-Spamd-Result: default: False [-8.19 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[zyxst.net:s=fm1,messagingengine.com:s=fm2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[25.4.111.66.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.25:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[zyxst.net]; DKIM_TRACE(0.00)[zyxst.net:+,messagingengine.com:+]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; IP_SCORE(-3.49)[ip: (-9.81), ipnet: 66.111.4.0/24(-4.89), asn: 11403(-2.68), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[25.4.111.66.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2020 16:21:59 -0000 --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Feb 11, 2020 at 04:55:25PM +0100, Polytropon wrote: >On Tue, 11 Feb 2020 15:50:09 +0000, tech-lists wrote: >> Which is it better to have - swapfile partition or swapfile? >> >> I have both, on a SSD. Thing is, I can write 10x faster to the >> file than I can >> to the partition. With a 512b block size, it can write at 17MB/s >> to the >> partition, and about 120-130MB/s to the swapfile, as reported by dd. > >Probably a partition is better because it saves the subsystems >accessing it to deal with the filesystem layer. A swap device >does not have a filesystem, and it's not under VFS control, so >no overhead of that kind. But given there's no overhead, then why on the face of it is it slower than= a swapfile? > >However, it is possible to "emulate" a swap device with a file, >and there are probably several ways to do this (for example, >virtual node: mdconfig + swapctl,=20 I have these at the moment in my /etc/fstab: /dev/ada0s1b none swap sw 0 0 md99 none swap sw,file=3D/swap0,late 0 0 md98 none swap sw,file=3D/swap1,late 0 0 The amount of RAM in the machine is 32GB, the swap partition is 4GB and each swapfile is 32GB The *reasoning behind* asking this is I use this machine for poudriere, and sometimes I'll see this in the logs: swap_pager: out of swap space swap_pager_getswapspace(10): failed swap_pager: indefinite wait buffer: bufobj: 0, blkno: 22294, size: 40960 and this happens even when not even half of the swap space has been used.= =20 Only the "out of swap space" problem happens when *only* the swap partition= =20 is enabled, when the swap partition fills up. I thought the indefinite wait buffer problem might be happening with just t= he swapfile, and that seems the case, but there is no defect with the SSD. I h= ave run it through fsck several times and all is good. smartmontools reports no defects. What I want is the swapfile to work like a swap partition and not report OOS errors when swap has not been exhausted. --=20 J. --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE8n3tWhxW11Ccvv9/s8o7QhFzNAUFAl5C1JcACgkQs8o7QhFz NAVoEQ/8Ckxs1Bs1eoY2Ag8q1pWD8l8m38fVxxCULK4x/iBPJLPSRCMk17PcsyiQ sTk5utlsVQDmSppCR0RswR1hf0+JluzY/EwMfnqjKuWC1E9OctBOACmHPZDlZQCy vvFpBP3G/4xGeWab1zTXL6nV09GSzmrdz9MNx0slxwMresUh415jnKSihQZXC2M0 f1E8WaRH8JPYesWIuN/s9W2hZGV9XBtf+f3klckneOai1pH3sOV4sY31rHYXhH2w X4bqsZUwL/PitRQcF3FJPxJIhZNe8X3xFLI9MCOcU4XsoTh3QGZPBhvpyAWiDhOM BUw6ZNz0unkkk855/sphE3+EHGMIb2e/Fl7XML/15VrrDWp95kXE2VxMN99MWtOY ftNrYWH5qd0zlriCCvqNMLUNfoDAq8m0zPZaiRZui44wtM3BEt444Y1arDza5m7f PzaglC7TiWFqzoCNN3bWFa0z5Z0qAyGWjGFWjSaXmvTgO30Wo4oOUqAsOrTocvVo QQKdgJ9UMTovMvpy5uLgguS0JZGN1GUzJws9N1AhMD5sf1AJvpdP38ipXEHt9azi /JLY4aIGMtG7sYLkFHLQ7XrFWQC8+hjjztfUdbVryYGnk2cwn/aI5ik3JdCGWegg UPkw2PWi9UiMMYAJ9aQYk2gm9UwyWZIHFd7V9uCOy5l5WOQkW6M= =evWn -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--