Date: Thu, 1 Nov 2007 23:29:57 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: "Arno J. Klaassen" <arno@heho.snv.jussieu.fr> Cc: freebsd-hackers@freebsd.org Subject: Re: "indefinite" wait buffer patch Message-ID: <20071101212957.GZ37471@deviant.kiev.zoral.com.ua> In-Reply-To: <wpsl3p1zvp.fsf@heho.snv.jussieu.fr> References: <wpsl3p1zvp.fsf@heho.snv.jussieu.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
--yTwVabqJa5IUz21H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 01, 2007 at 09:20:42PM +0100, Arno J. Klaassen wrote: > Hello, >=20 >=20 > while slowly testing releng_7, I remembered I have since about > two years the attached diff in my releng_6 sources (patch > recreated against releng_7 with low timeouts for debugging) : >=20 > it addresses the situation when one creates a huge swap-space on=20 > a (relatively) slow disk-subsystem : e.g. for scientific computing > it sometimes makes sense to have, e.g. 8G swap for 2G main memory > if you know you're treating N less then 2G matrices and process > is CPU-bound for quite a while for 1 matrix before switching to=20 > the other. > But then, when switching from one matrix to another, dmesg gets > flooded by : >=20 > "indefinite wait buffer"=20 >=20 > messages. >=20 > The attached patch shows in fact that the wait buffer is never > "indefinite" (unless a real HW-problem probably) and linearly > increases timeout to match with reality. I think this is mostly good. See below. >=20 > The last chunk is just to prevent for a panic at reboot when > there is so much data swapped out that is doesn't get treated > before 'reboot-finish-time-out'. This chunk would cause (non-silent) data corruption. Besides reboot, the code is used when swap is turned off on live system. Index: sys/vm/swap_pager.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/vm/swap_pager.c,v retrieving revision 1.295 diff -u -r1.295 swap_pager.c --- sys/vm/swap_pager.c 5 Aug 2007 21:04:32 -0000 1.295 +++ sys/vm/swap_pager.c 1 Nov 2007 18:59:18 -0000 @@ -941,6 +941,10 @@ =2E.. + static int timo_secs =3D TIMO_START; =2E.. + if (retry*TIMO_CHUNK > timo_secs) { + timo_secs =3D retry*TIMO_CHUNK; Imagine that two buffers got the timeout on swap-in simultaneously. I think that, instead, making timo_secs local variable would be right. Also, timeout reading one buffer shall not increase the timeout swapping in another one. --yTwVabqJa5IUz21H Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHKkVUC3+MBN1Mb4gRAgjWAKDJrXg8thPMtMTC8wHGbSsYjsWXLgCguYBd s4RAJQ+rNiAF7Qh9apE/qz0= =c0cx -----END PGP SIGNATURE----- --yTwVabqJa5IUz21H--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071101212957.GZ37471>