From nobody Wed Jan 12 03:21:25 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F0029195C081 for ; Wed, 12 Jan 2022 03:21:33 +0000 (UTC) (envelope-from peterj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JYXsT6T09z4hkp; Wed, 12 Jan 2022 03:21:33 +0000 (UTC) (envelope-from peterj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641957693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jMz88YHsRS42Sq8z96qcrDhgz8lv9Psa92Gr+dAc8Ec=; b=EcdVN4P57wMSXY+vmB4ZF76R/q4+QtIllA+egoX1pu+59bu50o1ZgKEh/JCeBeP/xMP82Y Fl9lOLHXZWB7FSG859kfwcxiwoYyalOocdapP+QK7e+xaq/gZPznKQZ+e9JBFGgoM9fR6i k1tnLIYGIjmrsE2XnTnfpbog9EXyYU5q+8hAqg06qMyAy1aLr+jtk4Jh0WRZwhAcc187SV ySHIjOxckXuKNuqY+RPthBMu/ZzxNaevfZG2ffuZEoOVuShl8tDumHfFmNvf5qqz9+HfJy PG6BIE3SfVQ7OGE4E5zubJtre10DD0c5JbYLCDPiIgw8hSHLfdIGF+Qqmy4eCg== Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: peterj) by smtp.freebsd.org (Postfix) with ESMTPSA id D10F9BC1F; Wed, 12 Jan 2022 03:21:32 +0000 (UTC) (envelope-from peterj@freebsd.org) Date: Wed, 12 Jan 2022 14:21:25 +1100 From: Peter Jeremy To: ralph41096 Cc: "freebsd-hackers@freebsd.org" Subject: Re: Out-of-swap killer and SIGTERM signal Message-ID: References: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YQZS0K7jK4RUas+L" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.rulingia.com/keys/peter.pgp ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641957693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jMz88YHsRS42Sq8z96qcrDhgz8lv9Psa92Gr+dAc8Ec=; b=CYwQ2A+n0tlZw+Q0lvfVe6shN0sAWl8EQpXhdjhkfW9lYZ0sxfLBJcDYAa17eZHBAXjhxD oPAykdbA21uKorX4k4YRL+KRKeu5gx9vMHRkkChYQDvZp97gh/nvoBAjWDH0nbew5zQRrs K4xLte4tTU8AEaQqUFbo6S6xzoMFQvG9PeW+qNe5e5ZfUFrVO/GfpmrT5fFfJNoBbKRZiz lrZRpG0pF8WdE6qsH9s9uduQ/SA4rANJGSUZf1lXhTcFykateIXIQ4/Zqz/nllpDYPiWWP pXlxUsqvOc1x6/lZSO57FaJtfoU0LX8qIcTLw6DMd6+jMclqqj/K/h0y0B9lVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641957693; a=rsa-sha256; cv=none; b=Cxu6PnxLsD6tJjuwCmt1ZXSqF1UBC4yaUNHCsU8fyYJ6kOOQsw0vn9fL/1hyXjeoOvaBOW SYqLKucRt9AUz2+3hZCLqNxsjeXB6Eco8Z5/icvUfoLlInDZYdwMYsCZio2j2jUFy/dTgl hpsLTcu17KZcTNnQ3v2Msrb/XfDsGiwHIDj+X5OnKrBSg0Z4hm60tHmmkQ9H438aJUEN9A 1HY7DWnCS031psuyR+ZWmrcf49t6Au36Eepz15lnHCuTInDsSM9CQBfzDI5UKYiqvdNynD 3RbvnRQZbtpMeJkDKiYkrkYmo+3MTQDdpsmTwR2jwi+uU1pdlmWiD+ZnzTi/QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --YQZS0K7jK4RUas+L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2022-Jan-10 12:55:56 +0000, ralph41096 wrote: >Do you think it would be a good idea to introduce the following soft >mode for the Out-of-swap killer? There have been lots of discussions about this in the past, starting in about 1998, (though I agree that it's been about 4 years since the last discussion). I suggest you search for "freebsd+sigdanger" for previous discussions. >New behaviour: > 1) If there is less than 2 GiB of free swap space, send SIGTERM > signals to the condemned processes, then wait for a 5 seconds > grace period, then send SIGKILL signals to the condemned processes > who are still running. 2 GiB seems quite a high limit, especially with a 5s grace period. That implies the system is using swap at 410 MiB/s - which seems unrealistic. It also means that you need to overprovision swap by 2 GiB since the last 2 GiB is effectively unusable. >These two system-wide parameters (2 GiB of free swap space, 5 seconds >grace period) could be defined in a configuration file, to allow the >administrator to change them. The FreeBSD model would be to make them sysctls. --=20 Peter Jeremy --YQZS0K7jK4RUas+L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmHeSTBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzSPkw//V6FrV9st3G2djUBqxbDAccdq3wJNZXdfLerDsMhpBQB693SUoDPszEsE NDQTTDKl9pT6HMaZlyO70gIRQE/KIouxAr3u+N9bvPm9Fh/kg2z+r/15HhGV2mTy Pjik+4WaXmqaBA7PaWvRNc2U7b6mS32jlO9Z/qpHLU3nBbIf+0MU+XhN1hrDO8sm qoTqVFNudPkhNHvjcwKphhHCvKAuyqE0LaRYhUZCv+ARiQrs2TaZKwOkFeyY48yM Ei1i4LQt8XZ/VJ38gXvh2pj8nILQut7hw8Wofo4T3PZnaSNKXqx/vS19CL33gZrq geX4lr5aHKV5J966gpbgM8/suz8Y6cwgaRCqRNGMfUsf3M9xdg0CeTA4ZzW9NEXz qrdBEPXfUT+RfR6Q+SBmeWP4nL/luHDRx6M09GJerYd8hGF2igacf5ZJfdHY7VO/ iHSSK0qaV6moYlyaXb1IYjwIBFSw2qDTWlO8lu1p8qbk0ycTxrQIiWEyTvom41+P 2f5jeEegDJrKRWUqnOBMQJbUW6bmjny2Dl2nAYvgSsd0keB0Pw5RgJaTO81CN5Pf DfGlMEvivX2tdI0kRPaoLKFSWnSwxDiAibfT3RQVBrW9XJgzmePK6Gspb7IXbPYE x2m+GbXbDtIDdgYSvoU0KAJKiU9wGR+utr+UVrkzapPA3jlX5HY= =CN8Y -----END PGP SIGNATURE----- --YQZS0K7jK4RUas+L--