Date: Tue, 11 Feb 2020 16:21:29 +0000 From: tech-lists <tech-lists@zyxst.net> To: freebsd-questions@freebsd.org Subject: Re: questions about swap (partition and file) Message-ID: <20200211162129.GC9715@bastion.zyxst.net> In-Reply-To: <20200211165552.e122bf2c.freebsd@edvax.de> References: <20200211155009.GA9715@bastion.zyxst.net> <20200211165552.e122bf2c.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200211162129.GC9715>